Method for decoding image on basis of cclm prediction in image coding system, and device therefor

ABSTRACT

A video decoding method performed by a decoding apparatus according to the present disclosure includes deriving one of a plurality of cross-component linear model (CCLM) prediction mode as a CCLM prediction mode of the current chroma block, deriving a sample number of neighboring chroma samples of the current chroma block based on the CCLM prediction mode of the current chroma block, a size of the current chroma block, and a specific value; deriving the neighboring chroma samples of the sample number, calculating CCLM parameters based on the neighboring chroma samples and the down sampled neighboring luma samples, deriving prediction samples for the current chroma block based on the CCLM parameters and the down sampled luma samples and generating reconstructed samples for the current chroma block based on the prediction samples, wherein the specific value is derived as 2.

CROSS-REFERENCE TO RELATED APPLICATION

Pursuant to 35 U.S.C. § 119(e), this application is a continuation ofInternational Application PCT/KR2019/015253, with an internationalfiling date of Nov. 11, 2019, which claims the benefit of U.S.Provisional Patent Application No. 62/770,835 filed on Nov. 23, 2018,the contents of which are hereby incorporated by reference herein in itsentirety.

BACKGROUND OF THE DISCLOSURE Field of the Disclosure

The present disclosure relates to a video coding technique, and moreparticularly, to a video decoding method and device based on CCLMprediction in a video coding system.

Related Art

Recently, demand for high-resolution, high-quality images such as HD(High Definition) images and UHD (Ultra High Definition) images havebeen increasing in various fields. As the image data has high resolutionand high quality, the amount of information or bits to be transmittedincreases relative to the legacy image data. Therefore, when image datais transmitted using a medium such as a conventional wired/wirelessbroadband line or image data is stored using an existing storage medium,the transmission cost and the storage cost thereof are increased.

Accordingly, there is a need for a highly efficient image compressiontechnique for effectively transmitting, storing, and reproducinginformation of high resolution and high quality images.

SUMMARY

The present disclosure provides a method and device for improving imagecoding efficiency.

The present disclosure also provides a method and device for improvingintra-prediction efficiency.

The present disclosure also provides a method and device for improvingintra-prediction efficiency based on Cross Component Linear Model(CCLM).

The present disclosure also provides an efficient encoding and decodingmethod of CCLM prediction including a plurality of CCLM predictionmodes, and a device for performing the encoding and decoding method.

The present disclosure also provides a method and device for selecting aneighboring sample for deriving a linear model parameter for a pluralityof CCLM prediction modes.

According to an embodiment of the present disclosure, a video decodingmethod performed by a decoding apparatus is provided. The methodincludes obtaining video information comprising prediction modeinformation for a current chroma block, deriving one of a plurality ofcross-component linear model (CCLM) prediction mode as a CCLM predictionmode of the current chroma block, deriving a sample number ofneighboring chroma samples of the current chroma block based on the CCLMprediction mode of the current chroma block, a size of the currentchroma block, and a specific value; deriving the neighboring chromasamples of the sample number, deriving down sampled neighboring lumasamples and down sampled luma samples of a current luma block, whereinthe neighboring luma samples correspond to the neighboring chromasamples, calculating CCLM parameters based on the neighboring chromasamples and the down sampled neighboring luma samples, derivingprediction samples for the current chroma block based on the CCLMparameters and the down sampled luma samples and generatingreconstructed samples for the current chroma block based on theprediction samples, wherein the specific value is derived as 2.

According to another embodiment of the present disclosure, a decodingapparatus for performing video decoding is provided. The decodingapparatus includes an entropy decoder for obtaining video informationcomprising prediction mode information for a current chroma block, apredictor for deriving one of a plurality of cross-component linearmodel (CCLM) prediction mode as a CCLM prediction mode of the currentchroma block, deriving a sample number of neighboring chroma samples ofthe current chroma block based on the CCLM prediction mode of thecurrent chroma block, a size of the current chroma block, and a specificvalue; deriving the neighboring chroma samples of the sample number,deriving down sampled neighboring luma samples and down sampled lumasamples of a current luma block, wherein the neighboring luma samplescorrespond to the neighboring chroma samples, calculating CCLMparameters based on the neighboring chroma samples and the down sampledneighboring luma samples, deriving prediction samples for the currentchroma block based on the CCLM parameters and the down sampled lumasamples, and a subtractor for generating reconstructed samples for thecurrent chroma block based on the prediction samples, wherein thespecific value is derived as 2.

According to still another embodiment of the present disclosure, a videoencoding method performed by an encoding apparatus is provided. Themethod includes determining a cross-component linear model (CCLM)prediction mode among a plurality of CCLM prediction modes; deriving asample number of neighboring chroma samples of the current chroma blockbased on the CCLM prediction mode of the current chroma block, a size ofthe current chroma block, and a specific value; deriving the neighboringchroma samples of the sample number; deriving down sampled neighboringluma samples and down sampled luma samples of a current luma block,wherein the neighboring luma samples correspond to the neighboringchroma samples; calculating CCLM parameters based on the neighboringchroma samples and the down sampled neighboring luma samples; derivingprediction samples for the current chroma block based on the CCLMparameters and the down sampled luma samples; and encoding videoinformation including prediction mode information for the current chromablock, wherein the specific value is derived as 2.

According to still another embodiment of the present disclosure, a videoencoding apparatus is provided. The encoding apparatus includes apredictor for determining a cross-component linear model (CCLM)prediction mode among a plurality of CCLM prediction modes, deriving asample number of neighboring chroma samples of the current chroma blockbased on the CCLM prediction mode of the current chroma block, a size ofthe current chroma block, and a specific value, deriving the neighboringchroma samples of the sample number, deriving down sampled neighboringluma samples and down sampled luma samples of a current luma block,wherein the neighboring luma samples correspond to the neighboringchroma samples, deriving CCLM parameters based on the neighboring chromasamples and the down sampled neighboring luma samples, derivingprediction samples for the current chroma block based on the CCLMparameters and the down sampled luma samples and an entropy encoder forencoding video information including prediction mode information for thecurrent chroma block, wherein the specific value is derived as 2.

According to the present disclosure, overall image/video compressionefficiency can be improved.

According to the present disclosure, the efficiency of intra-predictioncan be improved.

According to the present disclosure, the image coding efficiency can beimproved by performing an intra-prediction based on CCLM.

According to the present disclosure, the efficiency of intra-predictioncan be improved, which is based on CCLM including a plurality of LMmodes, that is, multi-directional Linear Model (MDLM).

According to the present disclosure, the number of neighboring samplesselected for deriving a linear model parameter for multi-directionalLinear Model (MDLM) performed in a chroma block having a great size islimited to a specific number, and accordingly, intra-predictioncomplexity can be reduced.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 briefly illustrates an example of a video/image coding device towhich embodiments of the present disclosure are applicable.

FIG. 2 is a schematic diagram illustrating a configuration of avideo/image encoding apparatus to which the embodiment(s) of the presentdocument may be applied.

FIG. 3 is a schematic diagram illustrating a configuration of avideo/image decoding apparatus to which the embodiment(s) of the presentdocument may be applied.

FIG. 4 illustrates intra-directional modes of 65 prediction directions.

FIG. 5 is a diagram for describing a process of deriving anintra-prediction mode of a current chroma block according to anembodiment.

FIG. 6 illustrates 2N reference samples for parameter calculation forCCLM prediction described above.

FIG. 7 illustrates LM_A (Linear Model_Above) mode and LM_L (LinearModel_Left) mode.

FIGS. 8a and 8b are diagrams for describing a procedure of performingCCLM prediction for a current chroma block according to an embodiment.

FIGS. 9a and 9b are diagrams for describing a procedure of performingCCLM prediction for a current chroma block according to an embodiment.

FIGS. 10a and 10b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 1 of the present embodiment described above.

FIGS. 11a and 11b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 2 of the present embodiment described above.

FIGS. 12a and 12b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 3 of the present embodiment described above.

FIGS. 13a and 13b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 4 of the present embodiment described above.

FIGS. 14a and 14b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 1 of the present embodiment described above.

FIGS. 15a and 15b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 2 of the present embodiment described above.

FIGS. 16a and 16b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 3 of the present embodiment described above.

FIG. 17 illustrates an example of selecting a neighboring referencesample of a chroma block.

FIGS. 18a to 18c illustrates neighboring reference samples derivedthrough the existing subsampling and neighboring reference samplesderived through subsampling according to the present embodiment.

FIG. 19 illustrates an example of performing a CCLM prediction usingsubsampling using Equation 6 described above.

FIGS. 20a and 20b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 1 of the present embodiment described above.

FIGS. 21a and 21b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 2 of the present embodiment described above.

FIGS. 22a and 22b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 3 of the present embodiment described above.

FIG. 23 is a diagram for describing a procedure of performing CCLMprediction based on the CCLM parameters of the current chroma blockderived according to method 4 of the present embodiment described above.

FIG. 24 schematically illustrates a video encoding method by theencoding apparatus according to the present disclosure.

FIG. 25 schematically illustrates the encoding apparatus performing theimage encoding method according to the present disclosure.

FIG. 26 schematically illustrates a video decoding method by thedecoding apparatus according to the present disclosure.

FIG. 27 schematically illustrates a decoding apparatus for performing avideo decoding method according to the present disclosure.

FIG. 28 illustrates a structural diagram of a contents streaming systemto which the present disclosure is applied.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

The present disclosure may be modified in various forms, and specificembodiments thereof will be described and illustrated in the drawings.However, the embodiments are not intended for limiting the disclosure.The terms used in the following description are used to merely describespecific embodiments but are not intended to limit the disclosure. Anexpression of a singular number includes an expression of the pluralnumber, so long as it is clearly read differently. The terms such as“include” and “have” are intended to indicate that features, numbers,steps, operations, elements, components, or combinations thereof used inthe following description exist and it should be thus understood thatthe possibility of existence or addition of one or more differentfeatures, numbers, steps, operations, elements, components, orcombinations thereof is not excluded.

Meanwhile, elements in the drawings described in the disclosure areindependently drawn for the purpose of convenience for explanation ofdifferent specific functions, and do not mean that the elements areembodied by independent hardware or independent software. For example,two or more elements of the elements may be combined to form a singleelement, or one element may be divided into plural elements. Theembodiments in which the elements are combined and/or divided belong tothe disclosure without departing from the concept of the disclosure.

Hereinafter, embodiments of the present disclosure will be described indetail with reference to the accompanying drawings. In addition, likereference numerals are used to indicate like elements throughout thedrawings, and the same descriptions on the like elements will beomitted.

FIG. 1 briefly illustrates an example of a video/image coding device towhich embodiments of the present disclosure are applicable.

Referring to FIG. 1, a video/image coding system may include a firstdevice (source device) and a second device (receiving device). Thesource device may deliver encoded video/image information or data in theform of a file or streaming to the receiving device via a digitalstorage medium or network.

The source device may include a video source, an encoding apparatus, anda transmitter. The receiving device may include a receiver, a decodingapparatus, and a renderer. The encoding apparatus may be called avideo/image encoding apparatus, and the decoding apparatus may be calleda video/image decoding apparatus. The transmitter may be included in theencoding apparatus. The receiver may be included in the decodingapparatus. The renderer may include a display, and the display may beconfigured as a separate device or an external component.

The video source may acquire video/image through a process of capturing,synthesizing, or generating the video/image. The video source mayinclude a video/image capture device and/or a video/image generatingdevice. The video/image capture device may include, for example, one ormore cameras, video/image archives including previously capturedvideo/images, and the like. The video/image generating device mayinclude, for example, computers, tablets and smartphones, and may(electronically) generate video/images. For example, a virtualvideo/image may be generated through a computer or the like. In thiscase, the video/image capturing process may be replaced by a process ofgenerating related data.

The encoding apparatus may encode input video/image. The encodingapparatus may perform a series of procedures such as prediction,transform, and quantization for compression and coding efficiency. Theencoded data (encoded video/image information) may be output in the formof a bitstream.

The transmitter may transmit the encoded image/image information or dataoutput in the form of a bitstream to the receiver of the receivingdevice through a digital storage medium or a network in the form of afile or streaming. The digital storage medium may include variousstorage mediums such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and thelike. The transmitter may include an element for generating a media filethrough a predetermined file format and may include an element fortransmission through a broadcast/communication network. The receiver mayreceive/extract the bitstream and transmit the received bitstream to thedecoding apparatus.

The decoding apparatus may decode the video/image by performing a seriesof procedures such as dequantization, inverse transform, and predictioncorresponding to the operation of the encoding apparatus.

The renderer may render the decoded video/image. The renderedvideo/image may be displayed through the display.

This document relates to video/image coding. For example, themethods/embodiments disclosed in this document may be applied to amethod disclosed in the versatile video coding (VVC), the EVC (essentialvideo coding) standard, the AOMedia Video 1 (AV1) standard, the 2ndgeneration of audio video coding standard (AVS2), or the next generationvideo/image coding standard (ex. H.267 or H.268, etc.).

This document presents various embodiments of video/image coding, andthe embodiments may be performed in combination with each other unlessotherwise mentioned.

In this document, video may refer to a series of images over time.Picture generally refers to a unit representing one image in a specifictime zone, and a slice/tile is a unit constituting part of a picture incoding. The slice/tile may include one or more coding tree units (CTUs).One picture may consist of one or more slices/tiles. One picture mayconsist of one or more tile groups. One tile group may include one ormore tiles. A brick may represent a rectangular region of CTU rowswithin a tile in a picture. A tile may be partitioned into multiplebricks, each of which consisting of one or more CTU rows within thetile. A tile that is not partitioned into multiple bricks may be alsoreferred to as a brick. A brick scan is a specific sequential orderingof CTUs partitioning a picture in which the CTUs are orderedconsecutively in CTU raster scan in a brick, bricks within a tile areordered consecutively in a raster scan of the bricks of the tile, andtiles in a picture are ordered consecutively in a raster scan of thetiles of the picture. A tile is a rectangular region of CTUs within aparticular tile column and a particular tile row in a picture. The tilecolumn is a rectangular region of CTUs having a height equal to theheight of the picture and a width specified by syntax elements in thepicture parameter set. The tile row is a rectangular region of CTUshaving a height specified by syntax elements in the picture parameterset and a width equal to the width of the picture. A tile scan is aspecific sequential ordering of CTUs partitioning a picture in which theCTUs are ordered consecutively in CTU raster scan in a tile whereastiles in a picture are ordered consecutively in a raster scan of thetiles of the picture. A slice includes an integer number of bricks of apicture that may be exclusively contained in a single NAL unit. A slicemay consists of either a number of complete tiles or only a consecutivesequence of complete bricks of one tile. Tile groups and slices may beused interchangeably in this document. For example, in this document, atile group/tile group header may be called a slice/slice header.

A pixel or a pel may mean a smallest unit constituting one picture (orimage). Also, ‘sample’ may be used as a term corresponding to a pixel. Asample may generally represent a pixel or a value of a pixel, and mayrepresent only a pixel/pixel value of a luma component or only apixel/pixel value of a chroma component.

A unit may represent a basic unit of image processing. The unit mayinclude at least one of a specific region of the picture and informationrelated to the region. One unit may include one luma block and twochroma (ex. cb, cr) blocks. The unit may be used interchangeably withterms such as block or area in some cases. In a general case, an M×Nblock may include samples (or sample arrays) or a set (or array) oftransform coefficients of M columns and N rows.

In this document, the term “/” and “,” should be interpreted to indicate“and/or.” For instance, the expression “A/B” may mean “A and/or B.”Further, “A, B” may mean “A and/or B.” Further, “A/B/C” may mean “atleast one of A, B, and/or C.” Also, “A/B/C” may mean “at least one of A,B, and/or C.”

Further, in the document, the term “or” should be interpreted toindicate “and/or.” For instance, the expression “A or B” may comprise 1)only A, 2) only B, and/or 3) both A and B. In other words, the term “or”in this document should be interpreted to indicate “additionally oralternatively.”

FIG. 2 is a schematic diagram illustrating a configuration of avideo/image encoding apparatus to which the embodiment(s) of the presentdocument may be applied. Hereinafter, the video encoding apparatus mayinclude an image encoding apparatus.

Referring to FIG. 2, the encoding apparatus 200 includes an imagepartitioner 210, a predictor 220, a residual processor 230, and anentropy encoder 240, an adder 250, a filter 260, and a memory 270. Thepredictor 220 may include an inter predictor 221 and an intra predictor222. The residual processor 230 may include a transformer 232, aquantizer 233, a dequantizer 234, and an inverse transformer 235. Theresidual processor 230 may further include a subtractor 231. The adder250 may be called a reconstructor or a reconstructed block generator.The image partitioner 210, the predictor 220, the residual processor230, the entropy encoder 240, the adder 250, and the filter 260 may beconfigured by at least one hardware component (ex. an encoder chipset orprocessor) according to an embodiment. In addition, the memory 270 mayinclude a decoded picture buffer (DPB) or may be configured by a digitalstorage medium. The hardware component may further include the memory270 as an internal/external component.

The image partitioner 210 may partition an input image (or a picture ora frame) input to the encoding apparatus 200 into one or moreprocessors. For example, the processor may be called a coding unit (CU).In this case, the coding unit may be recursively partitioned accordingto a quad-tree binary-tree ternary-tree (QTBTTT) structure from a codingtree unit (CTU) or a largest coding unit (LCU). For example, one codingunit may be partitioned into a plurality of coding units of a deeperdepth based on a quad tree structure, a binary tree structure, and/or aternary structure. In this case, for example, the quad tree structuremay be applied first and the binary tree structure and/or ternarystructure may be applied later. Alternatively, the binary tree structuremay be applied first. The coding procedure according to this documentmay be performed based on the final coding unit that is no longerpartitioned. In this case, the largest coding unit may be used as thefinal coding unit based on coding efficiency according to imagecharacteristics, or if necessary, the coding unit may be recursivelypartitioned into coding units of deeper depth and a coding unit havingan optimal size may be used as the final coding unit. Here, the codingprocedure may include a procedure of prediction, transform, andreconstruction, which will be described later. As another example, theprocessor may further include a prediction unit (PU) or a transform unit(TU). In this case, the prediction unit and the transform unit may besplit or partitioned from the aforementioned final coding unit. Theprediction unit may be a unit of sample prediction, and the transformunit may be a unit for deriving a transform coefficient and/or a unitfor deriving a residual signal from the transform coefficient.

The unit may be used interchangeably with terms such as block or area insome cases. In a general case, an M×N block may represent a set ofsamples or transform coefficients composed of M columns and N rows. Asample may generally represent a pixel or a value of a pixel, mayrepresent only a pixel/pixel value of a luma component or represent onlya pixel/pixel value of a chroma component. A sample may be used as aterm corresponding to one picture (or image) for a pixel or a pel.

In the encoding apparatus 200, a prediction signal (predicted block,prediction sample array) output from the inter predictor 221 or theintra predictor 222 is subtracted from an input image signal (originalblock, original sample array) to generate a residual signal residualblock, residual sample array), and the generated residual signal istransmitted to the transformer 232. In this case, as shown, a unit forsubtracting a prediction signal (predicted block, prediction samplearray) from the input image signal (original block, original samplearray) in the encoder 200 may be called a subtractor 231. The predictormay perform prediction on a block to be processed (hereinafter, referredto as a current block) and generate a predicted block includingprediction samples for the current block. The predictor may determinewhether intra prediction or inter prediction is applied on a currentblock or CU basis. As described later in the description of eachprediction mode, the predictor may generate various information relatedto prediction, such as prediction mode information, and transmit thegenerated information to the entropy encoder 240. The information on theprediction may be encoded in the entropy encoder 240 and output in theform of a bitstream.

The intra predictor 222 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block or may be located apartaccording to the prediction mode. In the intra prediction, predictionmodes may include a plurality of non-directional modes and a pluralityof directional modes. The non-directional mode may include, for example,a DC mode and a planar mode. The directional mode may include, forexample, 33 directional prediction modes or 65 directional predictionmodes according to the degree of detail of the prediction direction.However, this is merely an example, more or less directional predictionmodes may be used depending on a setting. The intra predictor 222 maydetermine the prediction mode applied to the current block by using aprediction mode applied to a neighboring block.

The inter predictor 221 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. Here, in order to reduce theamount of motion information transmitted in the inter prediction mode,the motion information may be predicted in units of blocks, subblocks,or samples based on correlation of motion information between theneighboring block and the current block. The motion information mayinclude a motion vector and a reference picture index. The motioninformation may further include inter prediction direction (L0prediction, L1 prediction, Bi prediction, etc.) information. In the caseof inter prediction, the neighboring block may include a spatialneighboring block present in the current picture and a temporalneighboring block present in the reference picture. The referencepicture including the reference block and the reference pictureincluding the temporal neighboring block may be the same or different.The temporal neighboring block may be called a collocated referenceblock, a co-located CU (colCU), and the like, and the reference pictureincluding the temporal neighboring block may be called a collocatedpicture (colPic). For example, the inter predictor 221 may configure amotion information candidate list based on neighboring blocks andgenerate information indicating which candidate is used to derive amotion vector and/or a reference picture index of the current block.Inter prediction may be performed based on various prediction modes. Forexample, in the case of a skip mode and a merge mode, the interpredictor 221 may use motion information of the neighboring block asmotion information of the current block. In the skip mode, unlike themerge mode, the residual signal may not be transmitted. In the case ofthe motion vector prediction (MVP) mode, the motion vector of theneighboring block may be used as a motion vector predictor and themotion vector of the current block may be indicated by signaling amotion vector difference.

The predictor 220 may generate a prediction signal based on variousprediction methods described below. For example, the predictor may notonly apply intra prediction or inter prediction to predict one block butalso simultaneously apply both intra prediction and inter prediction.This may be called combined inter and intra prediction (CIIP). Inaddition, the predictor may be based on an intra block copy (IBC)prediction mode or a palette mode for prediction of a block. The IBCprediction mode or palette mode may be used for content image/videocoding of a game or the like, for example, screen content coding (SCC).The IBC basically performs prediction in the current picture but may beperformed similarly to inter prediction in that a reference block isderived in the current picture. That is, the IBC may use at least one ofthe inter prediction techniques described in this document. The palettemode may be considered as an example of intra coding or intraprediction. When the palette mode is applied, a sample value within apicture may be signaled based on information on the palette table andthe palette index.

The prediction signal generated by the predictor (including the interpredictor 221 and/or the intra predictor 222) may be used to generate areconstructed signal or to generate a residual signal. The transformer232 may generate transform coefficients by applying a transformtechnique to the residual signal. For example, the transform techniquemay include at least one of a discrete cosine transform (DCT), adiscrete sine transform (DST), a karhunen-loève transform (KLT), agraph-based transform (GBT), or a conditionally non-linear transform(CNT). Here, the GBT means transform obtained from a graph whenrelationship information between pixels is represented by the graph. TheCNT refers to transform generated based on a prediction signal generatedusing all previously reconstructed pixels. In addition, the transformprocess may be applied to square pixel blocks having the same size ormay be applied to blocks having a variable size rather than square.

The quantizer 233 may quantize the transform coefficients and transmitthem to the entropy encoder 240 and the entropy encoder 240 may encodethe quantized signal (information on the quantized transformcoefficients) and output a bitstream. The information on the quantizedtransform coefficients may be referred to as residual information. Thequantizer 233 may rearrange block type quantized transform coefficientsinto a one-dimensional vector form based on a coefficient scanning orderand generate information on the quantized transform coefficients basedon the quantized transform coefficients in the one-dimensional vectorform. Information on transform coefficients may be generated. Theentropy encoder 240 may perform various encoding methods such as, forexample, exponential Golomb, context-adaptive variable length coding(CAVLC), context-adaptive binary arithmetic coding (CABAC), and thelike. The entropy encoder 240 may encode information necessary forvideo/image reconstruction other than quantized transform coefficients(ex. values of syntax elements, etc.) together or separately. Encodedinformation (ex. encoded video/image information) may be transmitted orstored in units of NALs (network abstraction layer) in the form of abitstream. The video/image information may further include informationon various parameter sets such as an adaptation parameter set (APS), apicture parameter set (PPS), a sequence parameter set (SPS), or a videoparameter set (VPS). In addition, the video/image information mayfurther include general constraint information. In this document,information and/or syntax elements transmitted/signaled from theencoding apparatus to the decoding apparatus may be included invideo/picture information. The video/image information may be encodedthrough the above-described encoding procedure and included in thebitstream. The bitstream may be transmitted over a network or may bestored in a digital storage medium. The network may include abroadcasting network and/or a communication network, and the digitalstorage medium may include various storage media such as USB, SD, CD,DVD, Blu-ray, HDD, SSD, and the like. A transmitter (not shown)transmitting a signal output from the entropy encoder 240 and/or astorage unit (not shown) storing the signal may be included asinternal/external element of the encoding apparatus 200, andalternatively, the transmitter may be included in the entropy encoder240.

The quantized transform coefficients output from the quantizer 233 maybe used to generate a prediction signal. For example, the residualsignal (residual block or residual samples) may be reconstructed byapplying dequantization and inverse transform to the quantized transformcoefficients through the dequantizer 234 and the inverse transformer235. The adder 250 adds the reconstructed residual signal to theprediction signal output from the inter predictor 221 or the intrapredictor 222 to generate a reconstructed signal (reconstructed picture,reconstructed block, reconstructed sample array). If there is noresidual for the block to be processed, such as a case where the skipmode is applied, the predicted block may be used as the reconstructedblock. The adder 250 may be called a reconstructor or a reconstructedblock generator. The generated reconstructed signal may be used forintra prediction of a next block to be processed in the current pictureand may be used for inter prediction of a next picture through filteringas described below.

Meanwhile, luma mapping with chroma scaling (LMCS) may be applied duringpicture encoding and/or reconstruction.

The filter 260 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter260 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and store the modifiedreconstructed picture in the memory 270, specifically, a DPB of thememory 270. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like. The filter 260 may generate variousinformation related to the filtering and transmit the generatedinformation to the entropy encoder 240 as described later in thedescription of each filtering method. The information related to thefiltering may be encoded by the entropy encoder 240 and output in theform of a bitstream.

The modified reconstructed picture transmitted to the memory 270 may beused as the reference picture in the inter predictor 221. When the interprediction is applied through the encoding apparatus, predictionmismatch between the encoding apparatus 200 and the decoding apparatusmay be avoided and encoding efficiency may be improved.

The DPB of the memory 270 DPB may store the modified reconstructedpicture for use as a reference picture in the inter predictor 221. Thememory 270 may store the motion information of the block from which themotion information in the current picture is derived (or encoded) and/orthe motion information of the blocks in the picture that have alreadybeen reconstructed. The stored motion information may be transmitted tothe inter predictor 221 and used as the motion information of thespatial neighboring block or the motion information of the temporalneighboring block. The memory 270 may store reconstructed samples ofreconstructed blocks in the current picture and may transfer thereconstructed samples to the intra predictor 222.

FIG. 3 is a schematic diagram illustrating a configuration of avideo/image decoding apparatus to which the embodiment(s) of the presentdocument may be applied.

Referring to FIG. 3, the decoding apparatus 300 may include an entropydecoder 310, a residual processor 320, a predictor 330, an adder 340, afilter 350, a memory 360. The predictor 330 may include an interpredictor 331 and an intra predictor 332. The residual processor 320 mayinclude a dequantizer 321 and an inverse transformer 321. The entropydecoder 310, the residual processor 320, the predictor 330, the adder340, and the filter 350 may be configured by a hardware component (ex. adecoder chipset or a processor) according to an embodiment. In addition,the memory 360 may include a decoded picture buffer (DPB) or may beconfigured by a digital storage medium. The hardware component mayfurther include the memory 360 as an internal/external component.

When a bitstream including video/image information is input, thedecoding apparatus 300 may reconstruct an image corresponding to aprocess in which the video/image information is processed in theencoding apparatus of FIG. 2. For example, the decoding apparatus 300may derive units/blocks based on block partition related informationobtained from the bitstream. The decoding apparatus 300 may performdecoding using a processor applied in the encoding apparatus. Thus, theprocessor of decoding may be a coding unit, for example, and the codingunit may be partitioned according to a quad tree structure, binary treestructure and/or ternary tree structure from the coding tree unit or thelargest coding unit. One or more transform units may be derived from thecoding unit. The reconstructed image signal decoded and output throughthe decoding apparatus 300 may be reproduced through a reproducingapparatus.

The decoding apparatus 300 may receive a signal output from the encodingapparatus of FIG. 2 in the form of a bitstream, and the received signalmay be decoded through the entropy decoder 310. For example, the entropydecoder 310 may parse the bitstream to derive information (ex.video/image information) necessary for image reconstruction (or picturereconstruction). The video/image information may further includeinformation on various parameter sets such as an adaptation parameterset (APS), a picture parameter set (PPS), a sequence parameter set(SPS), or a video parameter set (VPS). In addition, the video/imageinformation may further include general constraint information. Thedecoding apparatus may further decode picture based on the informationon the parameter set and/or the general constraint information.Signaled/received information and/or syntax elements described later inthis document may be decoded may decode the decoding procedure andobtained from the bitstream. For example, the entropy decoder 310decodes the information in the bitstream based on a coding method suchas exponential Golomb coding, CAVLC, or CABAC, and output syntaxelements required for image reconstruction and quantized values oftransform coefficients for residual. More specifically, the CABACentropy decoding method may receive a bin corresponding to each syntaxelement in the bitstream, determine a context model using a decodingtarget syntax element information, decoding information of a decodingtarget block or information of a symbol/bin decoded in a previous stage,and perform an arithmetic decoding on the bin by predicting aprobability of occurrence of a bin according to the determined contextmodel, and generate a symbol corresponding to the value of each syntaxelement. In this case, the CABAC entropy decoding method may update thecontext model by using the information of the decoded symbol/bin for acontext model of a next symbol/bin after determining the context model.The information related to the prediction among the information decodedby the entropy decoder 310 may be provided to the predictor (the interpredictor 332 and the intra predictor 331), and the residual value onwhich the entropy decoding was performed in the entropy decoder 310,that is, the quantized transform coefficients and related parameterinformation, may be input to the residual processor 320. The residualprocessor 320 may derive the residual signal (the residual block, theresidual samples, the residual sample array). In addition, informationon filtering among information decoded by the entropy decoder 310 may beprovided to the filter 350. Meanwhile, a receiver (not shown) forreceiving a signal output from the encoding apparatus may be furtherconfigured as an internal/external element of the decoding apparatus300, or the receiver may be a component of the entropy decoder 310.Meanwhile, the decoding apparatus according to this document may bereferred to as a video/image/picture decoding apparatus, and thedecoding apparatus may be classified into an information decoder(video/image/picture information decoder) and a sample decoder(video/image/picture sample decoder). The information decoder mayinclude the entropy decoder 310, and the sample decoder may include atleast one of the dequantizer 321, the inverse transformer 322, the adder340, the filter 350, the memory 360, the inter predictor 332, and theintra predictor 331.

The dequantizer 321 may dequantize the quantized transform coefficientsand output the transform coefficients. The dequantizer 321 may rearrangethe quantized transform coefficients in the form of a two-dimensionalblock form. In this case, the rearrangement may be performed based onthe coefficient scanning order performed in the encoding apparatus. Thedequantizer 321 may perform dequantization on the quantized transformcoefficients by using a quantization parameter (ex. quantization stepsize information) and obtain transform coefficients.

The inverse transformer 322 inversely transforms the transformcoefficients to obtain a residual signal (residual block, residualsample array).

The predictor may perform prediction on the current block and generate apredicted block including prediction samples for the current block. Thepredictor may determine whether intra prediction or inter prediction isapplied to the current block based on the information on the predictionoutput from the entropy decoder 310 and may determine a specificintra/inter prediction mode.

The predictor 320 may generate a prediction signal based on variousprediction methods described below. For example, the predictor may notonly apply intra prediction or inter prediction to predict one block butalso simultaneously apply intra prediction and inter prediction. Thismay be called combined inter and intra prediction (CIIP). In addition,the predictor may be based on an intra block copy (IBC) prediction modeor a palette mode for prediction of a block. The IBC prediction mode orpalette mode may be used for content image/video coding of a game or thelike, for example, screen content coding (SCC). The IBC basicallyperforms prediction in the current picture but may be performedsimilarly to inter prediction in that a reference block is derived inthe current picture. That is, the IBC may use at least one of the interprediction techniques described in this document. The palette mode maybe considered as an example of intra coding or intra prediction. Whenthe palette mode is applied, a sample value within a picture may besignaled based on information on the palette table and the paletteindex.

The intra predictor 331 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block or may be located apartaccording to the prediction mode. In the intra prediction, predictionmodes may include a plurality of non-directional modes and a pluralityof directional modes. The intra predictor 331 may determine theprediction mode applied to the current block by using a prediction modeapplied to a neighboring block.

The inter predictor 332 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. In this case, in order to reducethe amount of motion information transmitted in the inter predictionmode, motion information may be predicted in units of blocks, subblocks,or samples based on correlation of motion information between theneighboring block and the current block. The motion information mayinclude a motion vector and a reference picture index. The motioninformation may further include inter prediction direction (L0prediction, L1 prediction, Bi prediction, etc.) information. In the caseof inter prediction, the neighboring block may include a spatialneighboring block present in the current picture and a temporalneighboring block present in the reference picture. For example, theinter predictor 332 may configure a motion information candidate listbased on neighboring blocks and derive a motion vector of the currentblock and/or a reference picture index based on the received candidateselection information. Inter prediction may be performed based onvarious prediction modes, and the information on the prediction mayinclude information indicating a mode of inter prediction for thecurrent block.

The adder 340 may generate a reconstructed signal (reconstructedpicture, reconstructed block, reconstructed sample array) by adding theobtained residual signal to the prediction signal (predicted block,predicted sample array) output from the predictor (including the interpredictor 332 and/or the intra predictor 331). If there is no residualfor the block to be processed, such as when the skip mode is applied,the predicted block may be used as the reconstructed block.

The adder 340 may be called reconstructor or a reconstructed blockgenerator. The generated reconstructed signal may be used for intraprediction of a next block to be processed in the current picture, maybe output through filtering as described below, or may be used for interprediction of a next picture.

Meanwhile, luma mapping with chroma scaling (LMCS) may be applied in thepicture decoding process.

The filter 350 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter350 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and store the modifiedreconstructed picture in the memory 360, specifically, a DPB of thememory 360. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like.

The (modified) reconstructed picture stored in the DPB of the memory 360may be used as a reference picture in the inter predictor 332. Thememory 360 may store the motion information of the block from which themotion information in the current picture is derived (or decoded) and/orthe motion information of the blocks in the picture that have alreadybeen reconstructed. The stored motion information may be transmitted tothe inter predictor 260 so as to be utilized as the motion informationof the spatial neighboring block or the motion information of thetemporal neighboring block. The memory 360 may store reconstructedsamples of reconstructed blocks in the current picture and transfer thereconstructed samples to the intra predictor 331.

In the present disclosure, the embodiments described in the filter 260,the inter predictor 221, and the intra predictor 222 of the encodingapparatus 200 may be the same as or respectively applied to correspondto the filter 350, the inter predictor 332, and the intra predictor 331of the decoding apparatus 300. The same may also apply to the unit 332and the intra predictor 331.

Meanwhile, as described above, in performing video coding, a predictionis performed to enhance compression efficiency. Accordingly, aprediction block including prediction samples for a current block, thatis, a coding target block, may be generated. In this case, the predictedblock includes prediction samples in a spatial domain (or pixel domain).The prediction block is identically derived in the encoding apparatusand the decoding apparatus. The encoding apparatus may improve imagecoding efficiency by signaling residual information on a residualbetween an original block and the predicted block not an original samplevalue of the original block itself to the decoding apparatus. Thedecoding apparatus may derive a residual block including residualsamples based on the residual information, may generate a reconstructedblock including reconstructed samples by adding up the residual blockand the prediction block, and may generate a reconstructed pictureincluding the reconstructed block.

The residual information may be generated through a transform andquantization procedure. For example, the encoding apparatus may derivethe residual block between the original block and the predicted block,may derive transform coefficients by performing a transform procedure onthe residual samples (residual sample array) included in the residualblock, may derive quantized transform coefficients by performing aquantization procedure on the transform coefficients, and may signalrelated residual information to the decoding apparatus (through a bitstream). in this case, the residual information may include information,such as value information, location information, a transform scheme, atransform kernel and a quantization parameter of the quantized transformcoefficients. The decoding apparatus may perform adequantization/inverse transform procedure based on the residualinformation and may derive the residual samples (or residual block). Thedecoding apparatus may generate the reconstructed picture based on theprediction block and the residual block. The encoding apparatus may alsoderive the residual block by performing a dequantization/inversetransform on the quantized transform coefficients for the reference ofinter prediction of a subsequent picture and may generate thereconstructed picture based on the residual block.

FIG. 4 illustrates intra-directional modes of 65 prediction directions.

Referring to FIG. 4, intra-prediction modes having horizontaldirectionality and intra-prediction modes having vertical directionalitymay be classified based on an intra-prediction mode #34 having an upperleft diagonal prediction direction. H and V in FIG. 3 represent thehorizontal directionality and the vertical directionality, respectively,and the numbers from −32 to 32 represent displacements of 1/32 unit onsample grid positions. Intra-prediction modes #2 to #33 have thehorizontal directionality and intra-prediction modes #34 to #66 have thevertical directionality. Intra-prediction mode #18 and intra-predictionmode #50 represent a horizontal intra-prediction mode and a verticalintra-prediction mode, respectively. Intra-prediction modes #2 may becalled a lower left diagonal intra-prediction mode, intra-predictionmode #34 may be called an upper left diagonal intra-prediction mode andintra-prediction mode #66 may be called an upper right diagonalintra-prediction mode.

FIG. 5 is a diagram for describing a process of deriving anintra-prediction mode of a current chroma block according to anembodiment.

In the present disclosure, “chroma block”, “chroma image”, and the likemay represent the same meaning of chrominance block, chrominance image,and the like, and accordingly, chroma and chrominance may be commonlyused. Likewise, “luma block”, “luma image”, and the like may representthe same meaning of luminance block, luminance image, and the like, andaccordingly, luma and luminance may be commonly used.

In the present disclosure, a “current chroma block” may mean a chromacomponent block of a current block, which is a current coding unit, anda “current luma block” may mean a luma component block of a currentblock, which is a current coding unit. Accordingly, the current lumablock and the current chroma block correspond with each other. However,block formats and block numbers of the current luma block and thecurrent chroma block are not always the same but may be differentdepending on a case. In some cases, the current chroma block maycorrespond to the current luma region, and in this case, the currentluma region may include at least one luma block.

In the present disclosure, “reference sample template” may mean a set ofreference samples neighboring a current chroma block for predicting thecurrent chroma block. The reference sample template may be predefined,or information for the reference sample template may be signaled to thedecoding apparatus 300 from the encoding apparatus 200.

Referring to FIG. 5, a set of samples one shaded line neighboring 4×4block, which is a current chroma block, represents a reference sampletemplate. It is shown in FIG. 5 that the reference sample templateincludes a reference sample of one line, but the reference sample regionin a luma region corresponding to the reference sample template includestwo lines.

In an embodiment, when an intra encoding of a chroma image is performedin Joint Exploration TEST Model (JEM) used in Joint Video ExplorationTeam (JVET), Cross Component Linear Model (CCLM) may be used. CCLM is amethod of predicting a pixel value of a chroma image based on a pixelvalue of a reconstructed luma image, which is based on the property ofhigh correlation between a chroma image and a luma image.

CCLM prediction of Cb and Cr chroma images may be based on the equationbelow.

Pred_(C)(i,j)=α·Rec′_(L)(i,j)+β

Herein, pred_(c) (i, j) means Cb or Cr chroma image to be predicted,Rec_(L)′(i, j) means a luma image to be reconstructed which is adjustedto a chroma block size and (i, j) means a coordinate of a pixel. In4:2:0 color format, since a size of luma image is double of that of achroma image, Rec_(L)′ of a chroma block size should be generatedthrough down-sampling, and accordingly, a pixel of luma image to be usedin chroma image pred_(c) (i, j) may also use neighboring pixels inaddition to Rec_(L)(2i, 2j). The pred_(c) (i, j) may be represented as adown-sampled luma sample. In addition, a and β may be called a linearmodel or CCLM parameter. Particularly, a may be called a scaling factor,and β may be called an offset. Prediction mode information thatindicates whether CCLM prediction is applied to the current block may begenerated in the encoding apparatus and transmitted to the decodingapparatus, and the CCLM parameter may be calculated in the encodingapparatus and the decoding apparatus based on a neighboringreconstructed sample (or template) in the same way.

Meanwhile, for example, the pred_(c) (i, j) may be derived by using 6neighboring pixels as represented in the equation below.

Rec′_(L)(i,j)=(2×Rec_(L)(2i×2j)+2×Rec_(L)(2i,2j+1)+Rec_(L)(2i−1,2j)+Rec_(L)(2i+1,2j)+Rec_(L)(2i−1,2j+1)

In addition, as shown in the shaded area of FIG. 3, α and β represent across-correlation and a difference of average values between Cb or Crchroma block neighboring template and luma block neighboring template,and α and β are represented as Equation 3 below.

$\begin{matrix}{{\alpha = \frac{{M( {{t_{L}( {i,j} )} - {M( t_{L} )}} )} \times {M( {{t_{C}( {i,j} )} - {M( t_{C} )}} )}}{{M( {{t_{L}( {i,j} )} - {M( t_{L} )}} )} \times {M( {{t_{L}( {i,j} )} - {M( t_{L} )}} )}}},{\beta = {{M( t_{c} )} - {\alpha \; {M( t_{L} )}}}}} & \lbrack {{Equation}\mspace{14mu} 3} \rbrack\end{matrix}$

Here, t_(L) means a neighboring reference sample of a luma blockcorresponding to a current chroma image, t_(C) means neighboringreference sample of a current chroma block to which encoding is appliedcurrently, and (i, j) means a position of a pixel. In addition, M(A)means an average of A pixels.

Meanwhile, samples for parameter calculation (i.e., for example, α andβ) for CCLM prediction described above may be selected as below.

-   -   In the case that a current chroma block is a chroma block of N×N        size, total 2N (N horizontal and N vertical) neighboring        reference sample pairs (luma and chroma) of the current chroma        block may be selected.    -   In the case that a current chroma block is a chroma block of N×M        size or M×N size (herein, N<=M), total 2N (N horizontal and N        vertical) neighboring reference sample pairs of the current        chroma block may be selected. Meanwhile, since M is greater than        N (e.g., M=2N or 3N, etc.), among M samples, N sample pairs may        be selected through subsampling.

Alternatively, in the case that CCLM prediction is performed based on aplurality of CCLM modes, that is, in the case that multi-directionalLinear Model (MDLM) is applied, samples for parameter calculation may beselected as below.

-   -   In the case that a current chroma block is a chroma block of N×N        size to which the existing CCLM prediction, that is, Linear        Model_Left Top (LM_LT) mode is applied, total 2N (N horizontal        and N vertical) neighboring reference sample pairs (luma and        chroma) of the current chroma block may be selected. Here, the        LM_LT mode may also be called Linear Model_Left Above (LM_LA)        mode.    -   In the case that a current chroma block is a chroma block of N×M        size or M×N size (herein, N<=M) to which the LM_LT mode is        applied, total 2N (N horizontal and N vertical) neighboring        reference sample pairs of the current chroma block may be        selected. Meanwhile, since M is greater than N (e.g., M=2N or        3N, etc.), among M samples, N sample pairs may be selected        through subsampling.    -   In the case that a current chroma block is a chroma block of N×M        to which MDLM, that is, CCLM prediction mode except the LM_LT        mode is applied, Linear Model_Top (LM_T) mode may be applied to        the current chroma block, and total 2N upper neighboring        reference sample pairs may be selected. Here, the LM_T mode may        also be called Linear Model_Above (LM_A) mode.    -   In the case that a current chroma block is a chroma block of M×N        to which MDLM, that is, CCLM prediction mode except the LM_LT        mode is applied, Linear Model_Left (LM_L) mode may be applied to        the current chroma block, and total 2N left neighboring        reference sample pairs may be selected.

Meanwhile, the MDLM may represent the CCLM prediction performed based onthe CCLM prediction mode selected among a plurality of CCLM predictionmodes. The plurality of CCLM prediction modes may include the LM_L mode,the LM_T mode and the LM_LT mode. The LM_T mode may represent the CCLMprediction mode that performs CCLM using only a top reference sample ofthe current block, and the LM_L mode may represent the CCLM predictionmode that performs CCLM using only a left reference sample of thecurrent block. In addition, the LM_LT mode may represent the CCLMprediction mode that performs CCLM using a top reference sample and aleft reference sample of the current block like the existing CCLMprediction. Detailed description for the MDLM will be described below.

FIG. 6 illustrates 2N reference samples for parameter calculation forCCLM prediction described above. Referring to FIG. 6, 2N referencesample pairs are shown, which is derived for parameter calculation forthe CCLM prediction. The 2N reference sample pairs may include 2Nreference samples adjacent to the current chroma block and 2N referencesamples adjacent to the current luma block.

As described above, 2N sample pairs may be derived, and in the case thatCCLM parameters α and β are calculated using Equation 3 using the samplepair described above, the operation of numbers as represented in Table 1below may be required.

TABLE 1 operations Number of operations Multiplications 2N + 5 Sums 8N −1 Division 2

Referring to Table 1 above, for example, in the case of a chroma blockof 4×4 size, 21 multiplication operations and 31 addition operations maybe required for calculating CCLM parameter, and in the case of a chromablock of 32×32 size, 133 multiplication operations and 255 additionoperations may be required for calculating CCLM parameter. That is, asthe size of the chroma block increases, an amount of operation requiredfor calculating CCLM parameter increases rapidly, which may be directlyconnected to a delay problem in hardware implementation. Particularly,since the CCLM parameter should be derived through calculation eve inthe decoding apparatus, the amount of operation may be connected to adelay problem in hardware implementation of the decoding apparatus andincrease of implementation cost.

Meanwhile, in VTM 3.0, the CCLM parameter may be calculated by usingvariation inclination of two luma and chroma sample pair to decreasemultiplication and addition operations in calculating α and β. Forexample, the CCLM parameter may be calculated by the following equation.

$\begin{matrix}{{\alpha = \frac{y_{B} - y_{A}}{x_{B} - x_{A}}}{\beta = {y_{A} - {\alpha \; x_{A}}}}} & \lbrack {{Equation}\mspace{14mu} 4} \rbrack\end{matrix}$

Herein, (x_(A), y_(A)) may represent sample values a luma sample y_(A)of which luma value is the smallest among neighboring reference samplesof a current block for calculating the CCLM parameter and a chromasample x_(A) which is a pair of the luma sample, and (x_(B), y_(B)) mayrepresent sample values a luma sample y_(B) of which luma value is thegreatest among neighboring reference samples of a current block forcalculating the CCLM parameter and a chroma sample x_(B) which is a pairof the luma sample. That is, in other words, y_(A) may represent a lumasample of which luma value is the smallest among neighboring referencesamples of a current block, x_(A) may represent a chroma sample which isa pair of the luma sample y_(A), y_(B) may represent a luma sample ofwhich luma value is the greatest among neighboring reference samples ofa current block, and x_(B) may represent a chroma sample which is a pairof the luma sample y_(B).

Table 2 above illustrates the CCLM parameter derived by a simplifiedcalculation method.

When the CCLM parameter is calculated by using the equation describedabove, there is an advantage that the amount of multiplication andaddition operations may be reduced significantly in comparison with theexisting method, but since a minimum value and a maximum value should bedetermined among neighboring luma samples of a current block, acomparison operation is added. That is, in order to determine sampleminimum value and maximum value in 2N neighboring samples, 4N comparisonoperations are required, and the addition of the comparison operationsmay cause a delay in hardware implementation.

In addition, in performing CCLM prediction, multi-directional LM (MDLM),which is adopted in VTM 3.0, may be performed.

FIG. 7 illustrates LM_A (Linear Model_Above) mode and LM_L (LinearModel_Left) mode. The encoding apparatus and the decoding apparatus mayperform CCLM prediction to which the LM_A mode and the LM_L mode. TheLM_A mode may represent the CCLM prediction mode for performing CCLM byusing only a top reference sample of a current block. In this case, asshown in FIG. 7, CCLM prediction may be performed based on top referencesamples which is extended two times of the top reference samples in theexisting CCLM prediction to a right side. The LM_A mode may also becalled Linear Model_Top (LM_T) mode. Further, the LM_L mode mayrepresent the CCLM prediction mode for performing CCLM by using only aleft reference sample of the current block. In this case, as shown inFIG. 7, CCLM prediction may be performed based on left reference sampleswhich is extended two times of the left reference samples in theexisting CCLM prediction to a bottom side. Meanwhile, the mode ofperforming the CCLM prediction based on the existing CCLM prediction,that is, the top reference samples and the left reference samples of thecurrent block may be represented as LM_LA mode or LM_LT mode. Parameterα and β in the MDLM including a plurality of CCLM prediction modes maybe calculated by using a variation inclination of two luma and chromasample pair described above. Accordingly, many comparison operations arerequired in calculating parameters for the MDLM, and the addition ofcomparison operations may cause a delay in hardware implementation.Particularly, in the case that the CCLM parameter α and β are calculatedthrough Equation 4 that uses 2N sample pairs described above, 4Ncomparison operations are required. That is, in the case of 4×4 chromablock, 16 comparison operations are required for calculating CCLMparameter, and in the case of 32×32 chroma block, 128 comparisonoperations are required for calculating CCLM parameter. That is, as thesize of the chroma block increases, an amount of operation required forcalculating CCLM parameter increases rapidly, which may be directlyconnected to a delay problem in hardware implementation. Particularly,since the CCLM parameter should be derived through calculation eve inthe decoding apparatus, the addition of comparison operations may beconnected to a delay problem in hardware implementation of the decodingapparatus and increase of implementation cost.

Accordingly, a method of reducing the delay is required, and therefore,the present disclosure proposes embodiment for reducing operationcomplexity for deriving CCLM parameters, and through this, reducinghardware cost and complexity and time of decoding procedure.

The present embodiment may reduce operation complexity for deriving CCLMparameters, and through this, may reduce hardware cost and complexityand time of decoding procedure.

As an example, in order to solve the problem of increase of CCLMparameter operation amount as the chroma block size increase describedabove, an embodiment may be proposed for calculating a CCLM parameter byselecting a chroma block neighboring pixel, after configuring aneighboring sample selection upper limit N_(th) as described below. TheN_(th) may also be represented as a maximum neighboring sample number.For example, N_(th) may be set as 2, 4, 8 or 16.

The CCLM parameter calculation procedure according to the presentembodiment may be as below.

-   -   In the case that a current chroma block is a chroma block of N×N        size and N_(th)>=N, total 2N (N horizontal and N vertical)        neighboring reference sample pairs of the current chroma block        may be selected.    -   In the case that a current chroma block is a chroma block of N×N        size and N_(th)<N, total 2*N_(th) (2*N_(th) horizontal and        2*N_(th) vertical) neighboring reference sample pairs of the        current chroma block may be selected.    -   In the case that a current chroma block is a chroma block of N×M        size or M×N size (herein, N<=M) and N_(th)>=N, total 2N (N        horizontal and N vertical) neighboring reference sample pairs of        the current chroma block may be selected. Since M is greater        than N (e.g., M=2N or 3N, etc.), among M samples, N sample pairs        may be selected through subsampling.    -   In the case that a current chroma block is a chroma block of N×M        size or M×N size (herein, N<=M) and N_(th)<N, total 2*N_(th)        (2*N_(th) horizontal and 2*N_(th) vertical) neighboring        reference sample pairs of the current chroma block may be        selected. Since M is greater than N (e.g., M=2N or 3N, etc.),        among M samples, N_(th) sample pairs may be selected through        subsampling.

As described above, according to the present embodiment, a neighboringreference sample number for CCLM parameter calculation may be limited bysetting N_(th) which is a maximum number of selected neighboring samplenumbers, and through this, a CCLM parameter may be calculated throughrelatively less calculations even in a chroma block of big size.

In addition, in the case of setting N_(th) as relatively small number(e.g., 4 or 8), in hardware implementation of CCLM parametercalculation, a worst case operation (e.g., chroma block of 32×32 size)may be avoided, and therefore, a required hardware gate numbers may bereduced in comparison with the worst case, and through this, there isalso an effect of reducing hardware implementation cost.

For example, in the case that N_(th) is 2, 4 and 8, an amount of theCCLM parameter calculation for a chroma block size may be represented asthe following table.

TABLE 3 Number of operations ( multiplication + sums ) Proposed ProposedProposed Block Original method method method size CCLM (N_(th) = 2)(N_(th) = 4) (N_(th) = 8) N = 2  24 24 24 24 N = 4  44 24 44 44 N = 8 84 24 44 84 N = 16 164 24 44 84 N = 32 324 24 44 84

Meanwhile, N_(th) may be derived as a predetermined value in theencoding apparatus and the decoding apparatus without need to transmitadditional information representing N_(th). Alternatively, additionalinformation representing N_(th) may be transmitted in a unit of a CodingUnit (CU), a slice, a picture or a sequence, and N_(th) may be derivedbased on the additional information representing N_(th). The additionalinformation representing N_(th) may be generated and encoded in theencoding apparatus and may be transmitted or signaled to the decodingapparatus. Hereinafter, transmission or signaling of value N_(th) mayrepresent transmission or signaling of the information representingN_(th) from the encoding apparatus to the decoding apparatus.

For example, in the case that the additional information representingN_(th) is transmitted in a CU unit, when an intra-prediction mode of acurrent chroma block is the CCLM mode, as described below, a method maybe proposed to parse syntax element cclm_reduced_sample_flag and performa CCLM parameter calculation procedure. The cclm_reduced_sample_flag mayrepresent a syntax element of CCLM reduced sample flag.

-   -   In the case that the cclm_reduced_sample_flag is 0 (false), a        CCLM parameter calculation is performed through the existing        CCLM neighboring sample selection method.    -   In the case that the cclm_reduced_sample_flag is 1 (true),        N_(th) is set to 2, and a CCLM parameter calculation is        performed through the neighboring sample selection method        proposed in the present embodiment described above.

Alternatively, in the case that the additional information representingN_(th) is transmitted in a unit of slice, picture or sequence, asdescribed below, N_(th) value may be decoded based on the additionalinformation transmitted through a high level syntax (HLS). Theadditional information representing N_(th) may be encoded in theencoding apparatus and included in a bitstream, and then, transmitted.

For example, the additional information signaled through a slice headermay be represented as the following table.

TABLE 4 slice_hcadcr( ) { Descriptor  . . .  cclm_reduced_sample_numf(2) . . .

cclm_reduced_sample_num may represent a syntax element of the additionalinformation representing N_(th).

Alternatively, for example, the additional information signaled througha Picture Parameter Set (PPS) may be represented as the following table.

TABLE 5 pic_parameter_set_rbsp( ) { Descriptor  . . . cclm_reduced_sample_num f(2) . . .

Alternatively, for example, the additional information signaled througha Sequence Parameter Set (SPS) may be represented as the followingtable.

TABLE 6 seq_parameter_set_rbsp( ) { Descriptor  . . . cclm_reduced_sample_num f(2) . . .

N_(th) value, which is derived based on the cclm_reduced_sample_numvalue (i.e., a value derived by decoding cclm_reduced_sample_num)transmitted through the slice header, the PPS or the SPS, may be derivedas represented in the following table.

TABLE 7 cclm_reduced_ sample_num N_(th) 0  2 1  4 2  8 3 16

For example, referring to Table 7 above, N_(th) may be derived based onthe cclm_reduced_sample_num. In the case that thecclm_reduced_sample_num value is 0, N_(th) may be derived as 2, in thecase that the cclm_reduced_sample_num value is 1, N_(th) may be derivedas 4, in the case that the cclm_reduced_sample_num value is 2, N_(th)may be derived as 8, and in the case that the cclm_reduced_sample_numvalue is 3, N_(th) may be derived as 16.

Meanwhile, in the case that the additional information representingN_(th) is transmitted in a unit of CU, slice, picture or sequence, theencoding apparatus may determine the N_(th) value as below and transmitthe additional information representing N_(th) that represent the N_(th)value.

-   -   In the case that the additional information representing N_(th)        is transmitted in a unit of CU, when an intra-prediction mode of        the current chroma block is CCLM mode, the encoding apparatus        may determine a side of good encoding efficiency between two        following cases through RDO and transmit information of the        determined method to the decoding apparatus.

1) In the case that encoding efficiency is good when a CCLM parametercalculation is performed through the existing CCLM reference sampleselection method, cclm_reduced_sample_flag of value 0 (false) istransmitted.

2) In the case that encoding efficiency is good when N_(th) is set to 2and a CCLM parameter calculation is performed through the CCLM referencesample selection method proposed in the present embodiment,cclm_reduced_sample_flag of value 1 (true) is transmitted.

-   -   Alternatively, in the case that the additional information        representing N_(th) is transmitted in a unit of slice, picture        or sequence, the encoding apparatus may add a high level syntax        (HLS) as represented in Table 4, Table 5 or Table 6 described        above and transmit the additional information representing        N_(th). The encoding apparatus may configure the N_(th) value by        considering a size of input image or in accordance with an        encoding target bitrate.

1) For example, in the case that an input image is HD quality or more,the encoding apparatus may set as N_(th)=8, and in the case that aninput image is HD quality or less, the encoding apparatus may set asN_(th)=4.

2) In the case that image encoding of high quality is required, theencoding apparatus may set as N_(th)=8, and in the case that imageencoding of normal quality is required, the encoding apparatus may setas N_(th)=2.

Meanwhile, as represented in Table 3 described above, when the methodproposed in the present embodiment is used, it is identified that anamount of operation required for the CCLM parameter calculation is notincrease even a block size is increased. As an example, in the case thata current chroma block size is 32×32, an amount of operation requiredfor the CCLM parameter calculation may be reduced as 86% through themethod proposed in the present embodiment (e.g., it is set: N_(th)=4).

The table below may represent an experiment result data in the case thatthe N_(th) is 2.

TABLE 8 All Infra Main10 Over VTM-2.0.1 Y U V EncT DecT Class A1 0.58%2.19% 1.87% 100%  99% Class A2 0.37% 1.92% 0.83% 100% 100% Class B 0.21%0.91% 1.08% 100%  98% Class C 0.21% 1.07% 1.35%  99%  99% Class E 0.13%1.14% 0.88%  99%  98% Overall 0.28% 1.37% 1.20% 100%  99% Class D 0.18%1.05% 0.72%  99%  95%

In addition, the table below may represent an experiment result data inthe case that the N_(th) is 4.

TABLE 9 All Infra Main10 Over VTM-2.0.1 Y U V EncT DecT Class A1 0.58%2.19% 1.87% 100%  99% Class A2 0.37% 1.92% 0.83% 100% 100% Class B 0.21%0.91% 1.08% 100%  98% Class C 0.21% 1.07% 1.35%  99%  99% Class E 0.13%1.14% 0.88%  99%  98% Overall 0.28% 1.37% 1.20% 100%  99% Class D 0.18%1.05% 0.72%  99%  95%

In addition, the table below may represent an experiment result data inthe case that the N_(th) is 8.

TABLE 10 All Intra Main10 Over VTM-2.0.1 Y U V EncT DecT Class A1 0.00%−.22% −.14% 98% 98% Class A2 0.01% 0.18% −.05% 98% 98% Class B 0.00%−.04% −.06% 97% 94% Class C −.01% 0.02% 0.00% 95% 92% Class E −.02%0.00% −.17% 97% 95% Overall 0.00% −.01% −.08% 97% 95% Class D 0.01%0.02% −.10% 97% 92%

In addition, the table below may represent an experiment result data inthe case that the N_(th) is 16.

TABLE 11 All Infra Main10 Over VTM-2.0.1 Y U V EncT DecT Class A1 −.04%−.22% −.16% 99% 98% Class A2 0.00% 0.06% −.02% 98% 97% Class B −.01%−.02% −.09% 97% 94% Class C −.01% 0.01% 0.11% 97% 93% Class E −.01%−.21% −.12% 96% 90% Overall −.01% −.07% −.05% 97% 94% Class D −.01%0.06% −.07% 98% 92%

Table 8 to Table 11 above may represent coding efficiency and operationcomplexity in the case that the N_(th) is 2, 4, 8 and 16, respectively.

Referring to Table 8 to Table 11 above, it is identified that encodingefficiency is not significantly changed even in the case of reducing anamount of operation required for the CCLM parameter calculation. Forexample, referring to Table 9, in the case that the N_(th) is set to 4(N_(th)=4), encoding efficiency for each component is Y 0.04%, Cb 0.12%and Cr 0.07%, which identifies that encoding efficiency is notsignificantly changed in comparison with the case of not setting theN_(th), and encoding and decoding complexity is reduced to 97% and 95%,respectively.

In addition, referring to Table 10 and Table 11, in the case of reducingan amount of operation required for the CCLM parameter calculation(i.e., N_(th)=8 or 16), it is identified that encoding efficiencybecomes better, and encoding and decoding complexity is reduced.

The method proposed in the present embodiment may be used for a CCLMmode which is an intra-prediction mode for a chroma component, and thechroma block predicted through the CCLM mode may be used for deriving aresidual image through a differential from an original image in theencoding apparatus or used for reconstructed image through an additionwith a residual signal in the decoding apparatus.

FIGS. 8a and 8b are diagrams for describing a procedure of performingCCLM prediction for a current chroma block according to an embodiment.

Referring to FIG. 8a , the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S800). Forexample, the CCLM parameter may be calculated as the present embodimentshown in FIG. 8 b.

FIG. 8b may illustrate a specific embodiment of calculating the CCLMparameter. For example, referring to FIG. 8b , the encodingapparatus/decoding apparatus may set N_(th) for the current chroma block(step, S805). The N_(th) may be a predetermined value or derived basedon the additional information for N_(th). The N_(th) may be set to 2, 4,8 or 16.

Later, the encoding apparatus/decoding apparatus may determine whetherthe current chroma block is a square chroma block (step, S810).

In the case that the current chroma block is a square chroma block, theencoding apparatus/decoding apparatus may determine whether N, a widthof the current block, is greater than the N_(th) (step, S815).

In the case that N is greater than the N_(th), the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S820).

The encoding apparatus/decoding apparatus may derive parameters α and βfor the CCLM prediction based on the selected reference samples (step,S825).

In addition, in the case that N is not greater than the N_(th), theencoding apparatus/decoding apparatus may select 2N neighboring samplesin a reference line adjacent to the current block as a reference samplefor the CCLM parameter calculation (step, S830). Later, the encodingapparatus/decoding apparatus may derive the parameters α and β for theCCLM prediction based on the selected reference samples (step, S825).

Meanwhile, in the case that the current chroma block is not a squarechroma block, a size of the current chroma block may be derived in M×Nsize or N×M size (step, S835). Here, M may represent a value greaterthan N (N<M).

Later, the encoding apparatus/decoding apparatus determine whether the Nis greater than the N_(th) (step, S840).

In the case that N is greater than the N_(th), the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S845).

The encoding apparatus/decoding apparatus may derive parameters α and βfor the CCLM prediction based on the selected reference samples (step,S825).

In addition, in the case that N is not greater than the N_(th), theencoding apparatus/decoding apparatus may select 2N neighboring samplesin a reference line adjacent to the current block as a reference samplefor the CCLM parameter calculation (step, S850). Later, the encodingapparatus/decoding apparatus may derive the parameters α and β for theCCLM prediction based on the selected reference samples (step, S825).

Referring to FIG. 8a again, in the case that the parameters for CCLMprediction for the current chroma block is calculated, the encodingapparatus/decoding apparatus may perform the CCLM prediction based onthe parameters and generate a prediction sample for the current chromablock (step, S860). For example, the encoding apparatus/decodingapparatus may generate a prediction sample for the current chroma blockbased on the calculated parameters and Equation 1 described above inwhich reconstructed samples of the current luma block for the currentchroma block.

Meanwhile, in the present disclosure, in deriving the CCLM parameter, anembodiment which is different from the present embodiment of reducingoperation complexity for deriving the CCLM parameter may be proposed.

As an example, in order to solve the problem of increase of the CCLMparameter operation amount as the chroma block size increase describedabove, an embodiment may be proposed for calculating the CCLM parameterby configuring a neighboring sample selection upper limit N_(th) to ablock size of the current chroma block adaptively and selecting aneighboring pixel of the current chroma block based on the configuredN_(th). The N_(th) may also be represented as a maximum neighboringsample number.

For example, the N_(th) may be configured to a block size of the currentchroma block adaptively as below.

-   -   In the case that N<=TH in the current chroma block of N×M size        or M×N size (here, N<=M), it is configured: N_(th)=2.    -   In the case that N>TH in the current chroma block of N×M size or        M×N size (here, N<=M), it is configured: N_(th)=4.

In this case, for example, depending on a threshold value TH, areference sample used for calculating the CCLM parameter may be selectedas below.

For example, in the case that the TH is 4 (TH=4), and in the case thatthe N of the current chroma block is 2 or 4, two sample pairs for ablock side is used, and the CCLM parameter may be calculated, and in thecase that the N is 8, 16 or 32, four sample pairs for a block side isused, and the CCLM parameter may be calculated.

In addition, for example, in the case that the TH is 8 (TH=8), twosample pairs for a block side is used, and the CCLM parameter may becalculated, and in the case that the N is 16 or 32, four sample pairsfor a block side is used, and the CCLM parameter may be calculated.

As described above, according to the present embodiment, the N_(th) isconfigured to a block size of the current chroma block adaptively, asample number which is optimized for a block size may be selected.

For example, an amount of operation for the CCLM parameter calculationaccording to the existing CCLM reference sample selection method and thepresent embodiment may be represented as the following table.

TABLE 12 Number of operations (multiplication + sums) Proposed ProposedOriginal method method Block size CCLM (TH = 4) (TH = 8) N = 2   24 2424 N = 4   44 24 24 N = 8   84 44 24 N = 16 164 44 44 N = 32 324 44 44

Here, the N may represent the smallest value of a width and a height ofthe current block. Referring to Table 12 above, in the case that theCCLM reference sample selection method proposed in the presentembodiment is used, an amount of operation required for the CCLMparameter calculation is not increased even in the case that a blocksize is increased.

Meanwhile, the TH may be derived as a predetermined value in theencoding apparatus and the decoding apparatus without need to transmitadditional information representing the TH. Alternatively, additionalinformation representing the TH may be transmitted in a unit of CodingUnit (CU), slice, picture or sequence, and the TH may be derived basedon the additional information representing the TH. The additionalinformation representing the TH may represent a value of the TH.

For example, in the case that the additional information representing THis transmitted in a CU unit, when an intra-prediction mode of a currentchroma block is the CCLM mode, as described below, a method may beproposed to parse syntax element cclm_reduced_sample_flag and perform aCCLM parameter calculation procedure. The cclm_reduced_sample_flag mayrepresent a syntax element of CCLM reduced sample flag.

-   -   In the case that the cclm_reduced_sample_flag is 0 (false), it        is configured the N_(th)=4 for all blocks, and a CCLM parameter        calculation is performed through the neighboring sample        selection method of the present embodiment proposed in FIG. 8        described above.    -   In the case that the cclm_reduced_sample_flag is 1 (true), it is        configured the TH=4, and a CCLM parameter calculation is        performed through the neighboring sample selection method        proposed in the present embodiment described above.

Alternatively, in the case that the additional information representingTH is transmitted in a unit of slice, picture or sequence, as describedbelow, TH value may be decoded based on the additional informationtransmitted through a high level syntax (HLS).

For example, the additional information signaled through a slice headermay be represented as the following table.

TABLE 13 slice_header( ) { Descriptor   ...  cclm_reduced_sample_threshold u(1)  ...

cclm_reduced_sample_threshold may represent a syntax element of theadditional information representing TH.

Alternatively, for example, the additional information signaled througha Picture Parameter Set (PPS) may be represented as the following table.

TABLE 14 pic_parameter_set_rbsp( ) { Descriptor   ...  cclm_reduced_sample_threshold u(1)  ...Alternatively, for example, the additional information signaled througha Sequence Parameter Set (SPS) may be represented as the followingtable.

TABLE 15 sps_parameter_set_rbsp( ) { Descriptor   ...  cclm_reduced_sample_threshold u(1)  ...

TH value, which is derived based on the cclm_reduced_sample_thresholdvalue (i.e., a value derived by decoding cclm_reduced_sample_threshold)transmitted through the slice header, the PPS or the SPS, may be derivedas represented in the following table.

TABLE 16 cclm_reduced_sample_threshold TH 0 4 1 8

For example, referring to Table 16 above, the TH may be derived based onthe cclm_reduced_sample_threshold. In the case that thecclm_reduced_sample_threshold value is 0, the TH may be derived as 4,and in the case that the cclm_reduced_sample_threshold value is 1, theTH may be derived as 8.

Meanwhile, in the case that the TH is derived as a predetermined valuein the encoding apparatus and the decoding apparatus withouttransmitting separate additional information, the encoding apparatus mayperform the CCLM parameter calculation for the CCLM prediction as thepresent embodiment described above based on the predetermined TH value.

Alternatively, the encoding apparatus may determine whether to use thethreshold value TH and may transmit information representing whether touse the TH and the additional information representing the TH value tothe decoding apparatus as below.

-   -   In the case that the information representing whether to use the        TH is transmitted in a unit of CU, when an intra-prediction mode        of the current chroma block is CCLM mode (i.e., the CCLM        prediction is applied to the current chroma block), the encoding        apparatus may determine a side of good encoding efficiency        between two following cases through RDO and transmit information        of the determined method to the decoding apparatus.

1) In the case that encoding efficiency is good when the N_(th) is setto 4 for all blocks and a CCLM parameter calculation is performedthrough the reference sample selection method of the present embodimentproposed in FIG. 8 described above, cclm_reduced_sample_flag of value 0(false) is transmitted.

2) In the case that encoding efficiency is good when the TH is set to 4and a CCLM parameter calculation is performed through the referencesample selection method of the present embodiment proposed,cclm_reduced_sample_flag of value 1 (true) is transmitted.

-   -   Alternatively, in the case that the information representing        whether to use the TH is transmitted in a unit of slice, picture        or sequence, the encoding apparatus may add a high level syntax        (HLS) as represented in Table 13, Table 14 or Table 15 described        above and transmit the information representing whether to use        the TH. The encoding apparatus may configure the use of the TH        by considering a size of input image or in accordance with an        encoding target bitrate.

1) For example, in the case that an input image is HD quality or more,the encoding apparatus may set as TH=8, and in the case that an inputimage is HD quality or less, the encoding apparatus may set as TH=4.

2) In the case that image encoding of high quality is required, theencoding apparatus may set as TH=8, and in the case that image encodingof normal quality is required, the encoding apparatus may set as TH=4.

The method proposed in the present embodiment may be used for a CCLMmode which is an intra-prediction mode for a chroma component, and thechroma block predicted through the CCLM mode may be used for deriving aresidual image through a differential from an original image in theencoding apparatus or used for reconstructed image through an additionwith a residual signal in the decoding apparatus.

FIGS. 9a and 9b are diagrams for describing a procedure of performingCCLM prediction for a current chroma block according to an embodiment.

Referring to FIG. 9a , the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S900). Forexample, the CCLM parameter may be calculated as the present embodimentshown in FIG. 9 b.

FIG. 9b may illustrate a specific embodiment of calculating the CCLMparameter. For example, referring to FIG. 9b , the encodingapparatus/decoding apparatus may set TH for the current chroma block(step, S905). The TH may be a predetermined value or derived based onthe additional information for TH. The TH may be set to 4 or 8.

Later, the encoding apparatus/decoding apparatus may determine whetherthe current chroma block is a square chroma block (step, S910).

In the case that the current chroma block is a square chroma block, theencoding apparatus/decoding apparatus may determine whether N, a widthof the current block, is greater than the TH (step, S915).

In the case that N is greater than the TH, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S920). Here, the N_(th) may be 4.That is, in the case that N is greater than the TH, the N_(th) may be 4.

The encoding apparatus/decoding apparatus may derive parameters α and βfor the CCLM prediction based on the selected reference samples (step,S925).

In addition, in the case that N is not greater than the TH, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S930). That is, in the case that Nis not greater than the TH, the N_(th) may be 2. Later, the encodingapparatus/decoding apparatus may derive the parameters α and β for theCCLM prediction based on the selected reference samples (step, S925).

Meanwhile, in the case that the current chroma block is not a squarechroma block, a size of the current chroma block may be derived in M×Nsize or N×M size (step, S935). Here, M may represent a value greaterthan N (N<M).

Later, the encoding apparatus/decoding apparatus determine whether the Nis greater than the TH (step, S940).

In the case that N is greater than the TH, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S945). Here, the N_(th) may be 4.That is, in the case that N is greater than the TH, the N_(th) may be 4.

The encoding apparatus/decoding apparatus may derive parameters α and βfor the CCLM prediction based on the selected reference samples (step,S925).

In addition, in the case that N is not greater than the TH, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S950). Here, the N_(th) may be 2.That is, in the case that N is greater than the TH, the N_(th) may be 2.Later, the encoding apparatus/decoding apparatus may derive theparameters α and β for the CCLM prediction based on the selectedreference samples (step, S925).

Referring to FIG. 9a again, in the case that the parameters for CCLMprediction for the current chroma block is calculated, the encodingapparatus/decoding apparatus may perform the CCLM prediction based onthe parameters and generate a prediction sample for the current chromablock (step, S960). For example, the encoding apparatus/decodingapparatus may generate a prediction sample for the current chroma blockbased on the calculated parameters and Equation 1 described above inwhich reconstructed samples of the current luma block for the currentchroma block.

Meanwhile, in the present disclosure, in deriving the CCLM parameter, anembodiment which is different from the present embodiment of reducingoperation complexity for deriving the CCLM parameter may be proposed.

Particularly, in order to solve the problem of increase of CCLMparameter operation amount as the chroma block size increase describedabove, the present embodiment proposes a method of configuring a pixelselection upper limit N_(th) adaptively. In addition, in the case thatN=2 (here, N is a smaller value between a width and a height of a chromablock), in order to prevent the worst case operation (a case CCLMprediction is performed for all chroma blocks, after all chroma blocksin a CTU is divided into 2×2 size) occurred in CCLM prediction for achroma block of 2×2 size, the present embodiment proposes a method ofconfiguring N_(th) adaptively, and through this, an amount of operationfor CCLM parameter calculation in the worst cast may be reduced by about40%.

For example, according to the present embodiment, the N_(th) may beconfigured to a block size adaptively as below.

-   -   Method 1 in the present embodiment (proposed method 1)    -   In the case that N<=2 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 1 (N_(th)=1).    -   In the case that N=4 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 2 (N_(th)=2).    -   In the case that N>4 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 4 (N_(th)=4).

Alternatively, for example, according to the present embodiment, theN_(th) may be configured to a block size adaptively as below.

-   -   Method 2 in the present embodiment (proposed method 2)    -   In the case that N<=2 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 1 (N_(th)=1).    -   In the case that N=4 in the current chroma block of N×M size or

M×N size (here, e.g., N<=M), N_(th) may be set to 2 (N_(th)=2).

-   -   In the case that N=8 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 4 (N_(th)=4).    -   In the case that N>8 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 8 (N_(th)=8).

Alternatively, for example, according to the present embodiment, theN_(th) may be configured to a block size adaptively as below.

-   -   Method 3 in the present embodiment (proposed method 3)    -   In the case that N<=2 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 1 (N_(th)=1).    -   In the case that N>2 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 2 (N_(th)=2).

Alternatively, for example, according to the present embodiment, theN_(th) may be configured to a block size adaptively as below.

-   -   Method 4 in the present embodiment (proposed method 4)    -   In the case that N<=2 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 1 (N_(th)=1).    -   In the case that N>2 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 4 (N_(th)=4).

Method 1 to method 4 described above in the present embodiment mayreduce a complexity of the worst case by about 40%, and since N_(th) maybe adaptively applied to each chroma block size, encoding loss may beminimized. In addition, for example, since method 2 may apply N_(th) upto 8 in variable manner, this may proper to high quality image encoding.Since method 3 and method 4 may reduce N_(th) to 4 or 2, CCLM complexitymay be reduced significantly, and may proper to low image quality ormiddle image quality.

As described in method 1 to method 4, according to the presentembodiment, N_(th) may be configured adaptively to a block size, andthrough this, a reference sample number for deriving an optimized CCLMparameter may be selected.

The encoding apparatus/decoding apparatus may set the upper limit N_(th)for neighboring sample selection, and then, calculate a CCLM parameterby selecting a chroma block neighboring sample as described above.

An amount of CCLM parameter calculation according to a chroma block sizein the case to which the present embodiment described above is appliedmay be represented as the following table.

TABLE 17 Number of operations (multiplication + sums) Proposed ProposedProposed Proposed Block Original method 1 method 2 method 3 method 4size CCLM (N_(th) = 1, 2, 4) (N_(th) = 1, 2, 4, 8) (N_(th) = 1, 2)(N_(th) = 1, 4) N = 2   24 14 14 14 14 N = 4   44 24 24 24 44 N = 8   8444 44 24 44 N = 16 164 44 84 24 44 N = 32 324 44 84 24 44

As represented in Table 17 above, in the case that the methods proposedin the present embodiment is used, it is identified that an amount ofoperation required for the CCLM parameter calculation is not increaseeven a block size is increased.

Meanwhile, according to the present embodiment, without need to transmitadditional information, a promised value may be used in the encodingapparatus and the decoding apparatus, or it may be transmitted whetherto use the proposed method and information representing the N_(th) valuein a unit of CU, slice, picture and sequence.

For example, in the case that information representing whether to usethe proposed method is used in a unit of CU, when an intra-predictionmode of a current chroma block is CCLM mode (i.e., in the case that CCLMprediction is applied to the current chroma block),cclm_reduced_sample_flag may be parsed and the present embodimentdescribed above may be performed as below.

-   -   In the case that the cclm_reduced_sample_flag is 0 (false), it        is configured N_(th)=4 for all blocks, and a CCLM parameter        calculation is performed through the neighboring sample        selection method of the present embodiment proposed in FIG. 8        described above.    -   In the case that the cclm_reduced_sample_flag is 1 (true), a        CCLM parameter calculation is performed through method 3 of the        present embodiment described above.

Alternatively, in the case that the information representing the appliedmethod is transmitted in a unit of slice, picture or sequence, asdescribed below, the method among method 1 to method 4 may be selectedbased on the information transmitted through a high level syntax (HLS),and based on the selected method, the CCLM parameter may be calculated.

For example, the information representing the applied method signaledthrough a slice header may be represented as the following table.

TABLE 18 slice_header( ) { Descriptor   ...  cclm_reduced_sample_threshold f(2)  ...

cclm_reduced_sample_threshold may represent a syntax element of theinformation representing the applied method.

Alternatively, for example, the information representing the appliedmethod signaled through a Picture Parameter Set (PPS) may be representedas the following table.

TABLE 19 pic_parameter_set_rbsp( ) { Descriptor   ...  cclm_reduced_sample_threshold f(2)  ...

Alternatively, for example, the information representing the appliedmethod signaled through a Sequence Parameter Set (SPS) may berepresented as the following table.

TABLE 20 sps_parameter_set_rbsp( ) { Descriptor   ...  cclm_reduced_sample_threshold f(2)  ...

The method selected based on cclm_reduced_sample_threshold value (i.e.,a value derived by decoding cclm_reduced_sample_threshold) transmittedthrough the slice header, the PPS or the SPS may be derived asrepresented in the following table.

TABLE 21 cclm_reduced_sample_threshold Proposed method 0 1 (N_(th) = 1,2, 4)  1 2 (N_(th) = 1, 2, 4, 8) 2 3 (N_(th) = 1, 2)   3 4 (N_(th) = 1,4)  

Referring to Table. 21, in the case that thecclm_reduced_sample_threshold value is 0, method 1 may be selected asthe method applied to the current chroma block, in the case that thecclm_reduced_sample_threshold value is 1, method 2 may be selected asthe method applied to the current chroma block, in the case that thecclm_reduced_sample_threshold value is 2, method 3 may be selected asthe method applied to the current chroma block, and in the case that thecclm_reduced_sample_threshold value is 3, method 4 may be selected asthe method applied to the current chroma block.

The method proposed in the present embodiment may be used a CCLM modewhich is an intra-prediction mode for a chroma component, and the chromablock predicted through the CCLM mode may be used for deriving aresidual image through a differential from an original image in theencoding apparatus or used for deriving a reconstructed image through anaddition with a residual signal in the decoding apparatus.

Meanwhile, in the case that the information representing one of themethods is transmitted in a unit of CU, slice, picture and sequence, theencoding apparatus may determine one of method 1 to method 4 andtransmit the information to the decoding apparatus as below.

-   -   In the case that the information representing whether the method        of the present embodiment described above is applied is        transmitted in a unit of CU, when an intra-prediction mode of        the current chroma block is CCLM mode (i.e., the CCLM prediction        is applied to the current chroma block), the encoding apparatus        may determine a side of good encoding efficiency between two        following cases through RDO and transmit information of the        determined method to the decoding apparatus.

1) In the case that encoding efficiency is good when the N_(th) is setto 4 for all blocks and a CCLM parameter calculation is performedthrough the reference sample selection method of the present embodimentproposed in FIG. 8 described above, cclm_reduced_sample_flag of value 0(false) is transmitted.

2) In the case that encoding efficiency is good when it is configuredthat method 3 is applied and a CCLM parameter calculation is performedthrough the reference sample selection method of the present embodimentproposed, cclm_reduced_sample_flag of value 1 (true) is transmitted.

-   -   Alternatively, in the case that the information representing        whether the method of the present embodiment described above is        applied is transmitted in a unit of slice, picture or sequence,        the encoding apparatus may add a high level syntax (HLS) as        represented in Table 18, Table 19 or Table 20 described above        and transmit the information representing one method among the        methods. The encoding apparatus may configure the method applied        among the methods by considering a size of input image or in        accordance with an encoding target bitrate.

1) For example, in the case that an input image is HD quality or more,the encoding apparatus may apply method 2 (N_(th)=1, 2, 4 or 8), and inthe case that an input image is HD quality or less, the encodingapparatus may apply method 1 (N_(th)=1, 2 or 4).

2) In the case that image encoding of high quality is required, theencoding apparatus may apply method 2 (N_(th)=1, 2, 4 or 8), and in thecase that image encoding of normal quality is required, the encodingapparatus may apply method 4 (N_(th)=1 or 4).

The method proposed in the present embodiment may be used for a CCLMmode which is an intra-prediction mode for a chroma component, and thechroma block predicted through the CCLM mode may be used for deriving aresidual image through a differential from an original image in theencoding apparatus or used for reconstructed image through an additionwith a residual signal in the decoding apparatus.

FIGS. 10a and 10b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 1 of the present embodiment described above.

Referring to FIG. 10a , the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S1000). Forexample, the CCLM parameter may be calculated as the present embodimentshown in FIG. 10 b.

FIG. 10b may illustrate a specific embodiment of calculating the CCLMparameter. For example, referring to FIG. 10b , the encodingapparatus/decoding apparatus may determine whether the current chromablock is a square chroma block (step, S1005).

In the case that the current chroma block is a square chroma block, theencoding apparatus/decoding apparatus may set a width or a height of thecurrent block to N (step, S1010) and determine whether N is smaller than2 (N<2) (step, S1015).

Alternatively, in the case that the current chroma block is not a squarechroma block, a size of the current chroma block may be derived in M×Nsize or N×M size (step, S1020). The encoding apparatus/decodingapparatus determine whether the N is smaller than 2 (step, S1015). Here,the M represents a value greater than the N (N<M).

In the case that the N is smaller than 2, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1025). Here, the N_(th) may be 1(N_(th)=1).

The encoding apparatus/decoding apparatus may derive parameters α and βfor the CCLM prediction based on the selected reference samples (step,S1030).

Meanwhile, in the case that the N is not smaller than 2, the encodingapparatus/decoding apparatus may determine whether the N is 4 or less(N<=4) (step, S1035).

In the case that N is 4 or less, the encoding apparatus/decodingapparatus may select 2N_(th) neighboring samples in a reference lineadjacent to the current block as a reference sample for the CCLMparameter calculation (step, S1040). Here, the N_(th) may be 2. Later,the encoding apparatus/decoding apparatus may derive the parameters αand β for the CCLM prediction based on the selected reference samples(step, S1030).

Alternatively, in the case that N is greater than 4, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1045). Here, the N_(th) may be 4(N_(th)=4). Later, the encoding apparatus/decoding apparatus may derivethe parameters α and β for the CCLM prediction based on the selectedreference samples (step, S1030).

Referring to FIG. 10a again, in the case that the parameters for CCLMprediction for the current chroma block is calculated, the encodingapparatus/decoding apparatus may perform the CCLM prediction based onthe parameters and generate a prediction sample for the current chromablock (step, S1050). For example, the encoding apparatus/decodingapparatus may generate a prediction sample for the current chroma blockbased on the calculated parameters and Equation 1 described above inwhich reconstructed samples of the current luma block for the currentchroma block.

FIGS. 11a and 11b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 2 of the present embodiment described above.

Referring to FIG. 11a , the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S1100). Forexample, the CCLM parameter may be calculated as the present embodimentshown in FIG. 11 b.

FIG. 11b may illustrate a specific embodiment of calculating the CCLMparameter. For example, referring to FIG. 11b , the encodingapparatus/decoding apparatus may determine whether the current chromablock is a square chroma block (step, S1105).

In the case that the current chroma block is a square chroma block, theencoding apparatus/decoding apparatus may set a width or a height of thecurrent block to N (step, S1110) and determine whether N is smaller than2 (N<2) (step, S1115).

Alternatively, in the case that the current chroma block is not a squarechroma block, a size of the current chroma block may be derived in M×Nsize or N×M size (step, S1120). The encoding apparatus/decodingapparatus determine whether the N is smaller than 2 (step, S1115). Here,the M represents a value greater than the N (N<M).

In the case that the N is smaller than 2, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1125). Here, the N_(th) may be 1(N_(th)=1).

The encoding apparatus/decoding apparatus may derive parameters α and βfor the CCLM prediction based on the selected reference samples (step,S1130).

Meanwhile, in the case that the N is not smaller than 2, the encodingapparatus/decoding apparatus may determine whether the N is 4 or less(N<=4) (step, S1135).

In the case that N is 4 or less, the encoding apparatus/decodingapparatus may select 2N_(th) neighboring samples in a reference lineadjacent to the current block as a reference sample for the CCLMparameter calculation (step, S1140). Here, the N_(th) may be 2. Later,the encoding apparatus/decoding apparatus may derive the parameters αand β for the CCLM prediction based on the selected reference samples(step, S1130).

Meanwhile, in the case that the N is greater than 4, the encodingapparatus/decoding apparatus may determine whether the N is 8 or less(N<=8) (step, S1145).

In the case that the N is 8 or less, the encoding apparatus/decodingapparatus may select 2N_(th) neighboring samples in a reference lineadjacent to the current block as a reference sample for the CCLMparameter calculation (step, S1150).

Here, the N_(th) may be 4 (N_(th)=4). Later, the encodingapparatus/decoding apparatus may derive the parameters α and β for theCCLM prediction based on the selected reference samples (step, S1130).

Alternatively, in the case that the N is greater than 8, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1155). Here, the N_(th) may be 8(N_(th)=8). Later, the encoding apparatus/decoding apparatus may derivethe parameters α and β for the CCLM prediction based on the selectedreference samples (step, S1130).

Referring to FIG. 11a again, in the case that the parameters for CCLMprediction for the current chroma block is calculated, the encodingapparatus/decoding apparatus may perform the CCLM prediction based onthe parameters and generate a prediction sample for the current chromablock (step, S1160). For example, the encoding apparatus/decodingapparatus may generate a prediction sample for the current chroma blockbased on the calculated parameters and Equation 1 described above inwhich reconstructed samples of the current luma block for the currentchroma block.

FIGS. 12a and 12b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 3 of the present embodiment described above.

Referring to FIG. 12a , the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S1200). Forexample, the CCLM parameter may be calculated as the present embodimentshown in FIG. 12 b.

FIG. 12b may illustrate a specific embodiment of calculating the CCLMparameter. For example, referring to FIG. 12b , the encodingapparatus/decoding apparatus may determine whether the current chromablock is a square chroma block (step, S1205).

In the case that the current chroma block is a square chroma block, theencoding apparatus/decoding apparatus may set a width or a height of thecurrent block to N (step, S1210) and determine whether N is smaller than2 (N<2) (step, S1215).

Alternatively, in the case that the current chroma block is not a squarechroma block, a size of the current chroma block may be derived in M×Nsize or N×M size (step, S1220). The encoding apparatus/decodingapparatus determine whether the N is smaller than 2 (step, S1215). Here,the M represents a value greater than the N (N<M).

In the case that the N is smaller than 2, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1225). Here, the N_(th) may be 1(N_(th)=1).

The encoding apparatus/decoding apparatus may derive parameters α and βfor the CCLM prediction based on the selected reference samples (step,S1230).

Meanwhile, in the case that the N is not smaller than 2, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1235). Here, the N_(th) may be 2.Later, the encoding apparatus/decoding apparatus may derive theparameters α and β for the CCLM prediction based on the selectedreference samples (step, S1230).

Referring to FIG. 12a again, in the case that the parameters for CCLMprediction for the current chroma block is calculated, the encodingapparatus/decoding apparatus may perform the CCLM prediction based onthe parameters and generate a prediction sample for the current chromablock (step, S1240). For example, the encoding apparatus/decodingapparatus may generate a prediction sample for the current chroma blockbased on the calculated parameters and Equation 1 described above inwhich reconstructed samples of the current luma block for the currentchroma block.

FIGS. 13a and 13b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 4 of the present embodiment described above.

Referring to FIG. 13a , the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S1300). Forexample, the CCLM parameter may be calculated as the present embodimentshown in FIG. 13 b.

FIG. 13b may illustrate a specific embodiment of calculating the CCLMparameter. For example, referring to FIG. 13b , the encodingapparatus/decoding apparatus may determine whether the current chromablock is a square chroma block (step, S1305).

In the case that the current chroma block is a square chroma block, theencoding apparatus/decoding apparatus may set a width or a height of thecurrent block to N (step, S1310) and determine whether N is smaller than2 (N<2) (step, S1315).

Alternatively, in the case that the current chroma block is not a squarechroma block, a size of the current chroma block may be derived in M×Nsize or N×M size (step, S1320). The encoding apparatus/decodingapparatus determine whether the N is smaller than 2 (step, S1315). Here,the M represents a value greater than the N (N<M).

In the case that the N is smaller than 2, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1325). Here, the N_(th) may be 1(N_(th)=1).

The encoding apparatus/decoding apparatus may derive parameters α and βfor the CCLM prediction based on the selected reference samples (step,S1330).

Meanwhile, in the case that the N is not smaller than 2, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1335). Here, the N_(th) may be 4.Later, the encoding apparatus/decoding apparatus may derive theparameters α and β for the CCLM prediction based on the selectedreference samples (step, S1330).

Referring to FIG. 13a again, in the case that the parameters for CCLMprediction for the current chroma block is calculated, the encodingapparatus/decoding apparatus may perform the CCLM prediction based onthe parameters and generate a prediction sample for the current chromablock (step, S1340). For example, the encoding apparatus/decodingapparatus may generate a prediction sample for the current chroma blockbased on the calculated parameters and Equation 1 described above inwhich reconstructed samples of the current luma block for the currentchroma block.

Meanwhile, in the present disclosure, in deriving the CCLM parameter, anembodiment which is different from the present embodiment of reducingoperation complexity for deriving the CCLM parameter may be proposed.

Particularly, in order to solve the problem of increase of CCLMparameter operation amount as the chroma block size increase describedabove, the present embodiment proposes a method of configuring a pixelselection upper limit N_(th) adaptively.

For example, according to the present embodiment, the N_(th) may beconfigured to a block size adaptively as below.

-   -   Method 1 in the present embodiment (proposed method 1)    -   In the case that a current chroma block is a chroma block of 2×2        size, N_(th) may be set to 1 (N_(th)=1).    -   In the case that N=2 in the current chroma block of N×M size or        M×N size (here, e.g., N<M), N_(th) may be set to 2 (N_(th)=2).    -   In the case that N>2 in the current chroma block of N×M size or

M×N size (here, e.g., N<=M), N_(th) may be set to 4 (N_(th)=4).

Alternatively, for example, according to the present embodiment, theN_(th) may be configured to a block size adaptively as below.

-   -   Method 2 in the present embodiment (proposed method 2)    -   In the case that a current chroma block is a chroma block of 2×2        size, N_(th) may be set to 1 (N_(th)=1).    -   In the case that N=2 in the current chroma block of N×M size or        M×N size (here, e.g., N<M), N_(th) may be set to 2 (N_(th)=2).    -   In the case that N=4 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 2 (N_(th)=2).    -   In the case that N>4 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 4 (N_(th)=4).

Alternatively, for example, according to the present embodiment, theN_(th) may be configured to a block size adaptively as below.

-   -   Method 3 in the present embodiment (proposed method 3)    -   In the case that a current chroma block is a chroma block of 2×2        size, N_(th) may be set to 1 (N_(th)=1).    -   In the case that N=2 in the current chroma block of N×M size or        M×N size (here, e.g., N<M), N_(th) may be set to 2 (N_(th)=2).    -   In the case that N=4 in the current chroma block of N×M size or

M×N size (here, e.g., N<=M), N_(th) may be set to 4 (N_(th)=4).

-   -   In the case that N>4 in the current chroma block of N×M size or        M×N size (here, e.g., N<=M), N_(th) may be set to 8 (N_(th)=8).

Method 1 to method 3 described above in the present embodiment mayreduce a complexity of the worst case in the case that the currentchroma block is 2×2 by about 40%, and since N_(th) may be adaptivelyapplied to each chroma block size, encoding loss may be minimized. Inaddition, for example, since method 1 and method 3 may apply N_(th) to 4in the case of N>2, this may proper to high quality image encoding.Since method 2 may reduce N_(th) to 2 even in the case of N=4, CCLMcomplexity may be reduced significantly, and may proper to low imagequality or middle image quality.

As described in method 1 to method 3, according to the presentembodiment, N_(th) may be configured adaptively to a block size, andthrough this, a reference sample number for deriving an optimized CCLMparameter may be selected.

The encoding apparatus/decoding apparatus may set the upper limit N_(th)for neighboring sample selection, and then, calculate a CCLM parameterby selecting a chroma block neighboring sample as described above.

An amount of CCLM parameter calculation according to a chroma block sizein the case to which the present embodiment described above is appliedmay be represented as the following table.

TABLE 22 Number of operations (multiplication + sums) Proposed ProposedProposed Original method 1 method 2 method 2 Block size CCLM (N_(th) =1, 2, 4) (N_(th) = 1, 2, 2, 4) (N_(th) = 1, 2, 4, 8) 2 × 2  24 14 14 14N = 2   24 24 24 24 N = 4   44 44 24 44 N = 8   84 44 44 84 N = 16 16444 44 84 N = 32 324 44 44 84

As represented in Table 22 above, in the case that the methods proposedin the present embodiment is used, it is identified that an amount ofoperation required for the CCLM parameter calculation is not increaseeven a block size is increased.

Meanwhile, according to the present embodiment, without need to transmitadditional information, a promised value may be used in the encodingapparatus and the decoding apparatus, or it may be transmitted whetherto use the proposed method and information representing the N_(th) valuein a unit of CU, slice, picture and sequence.

For example, in the case that information representing whether to usethe proposed method is used in a unit of CU, when an intra-predictionmode of a current chroma block is CCLM mode (i.e., in the case that CCLMprediction is applied to the current chroma block),cclm_reduced_sample_flag may be parsed and the present embodimentdescribed above may be performed as below.

-   -   In the case that the cclm_reduced_sample_flag is 0 (false), it        is configured N_(th)=2 for all blocks, and a CCLM parameter        calculation is performed through the neighboring sample        selection method of the present embodiment proposed in FIG. 8        described above.    -   In the case that the cclm_reduced_sample_flag is 1 (true), a        CCLM parameter calculation is performed through method 1 of the        present embodiment described above.

Alternatively, in the case that the information representing the appliedmethod is transmitted in a unit of slice, picture or sequence, asdescribed below, the method among method 1 to method 3 may be selectedbased on the information transmitted through a high level syntax (HLS),and based on the selected method, the CCLM parameter may be calculated.

For example, the information representing the applied method signaledthrough a slice header may be represented as the following table.

TABLE 23 slice_header( ) { Descriptor   ...  cclm_reduced_sample_threshold f(2)  ...

cclm_reduced_sample_threshold may represent a syntax element of theinformation representing the applied method.

Alternatively, for example, the information representing the appliedmethod signaled through a Picture Parameter Set (PPS) may be representedas the following table.

TABLE 24 pic_parameter_set_rbsp( ) { Descriptor   ...  cclm_reduced_sample_threshold f(2)  ...

Alternatively, for example, the information representing the appliedmethod signaled through a Sequence Parameter Set (SPS) may berepresented as the following table.

TABLE 25 sps_parameter_set_rbsp( ) { Descriptor   ...  cclm_reduced_sample_threshold f(2)  ...

The method selected based on cclm_reduced_sample_threshold value (i.e.,a value derived by decoding cclm_reduced_sample_threshold) transmittedthrough the slice header, the PPS or the SPS may be derived asrepresented in the following table.

TABLE 26 cclm_reduced_sample_threshold Proposed method 0 Not apply 1 1(N_(th) = 1, 2, 4)  2 2 (N_(th) = 1, 2, 2, 4) 3 3 (N_(th) = 1, 2, 4, 8)

Referring to Table. 26, in the case that thecclm_reduced_sample_threshold value is 0, the methods of the presentembodiment described above may not be applied to the current chromablock, in the case that the cclm_reduced_sample_threshold value is 1,method 1 may be selected as the method applied to the current chromablock, in the case that the cclm_reduced_sample_threshold value is 2,method 2 may be selected as the method applied to the current chromablock, and in the case that the cclm_reduced_sample_threshold value is3, method 3 may be selected as the method applied to the current chromablock.

The method proposed in the present embodiment may be used a CCLM modewhich is an intra-prediction mode for a chroma component, and the chromablock predicted through the CCLM mode may be used for deriving aresidual image through a differential from an original image in theencoding apparatus or used for deriving a reconstructed image through anaddition with a residual signal in the decoding apparatus.

Meanwhile, in the case that the information representing one of themethods is transmitted in a unit of CU, slice, picture and sequence, theencoding apparatus may determine one of method 1 to method 3 andtransmit the information to the decoding apparatus as below.

-   -   In the case that the information representing whether the method        of the present embodiment described above is applied is        transmitted in a unit of CU, when an intra-prediction mode of        the current chroma block is CCLM mode (i.e., the CCLM prediction        is applied to the current chroma block), the encoding apparatus        may determine a side of good encoding efficiency between two        following cases through RDO and transmit information of the        determined method to the decoding apparatus.

1) In the case that encoding efficiency is good when the N_(th) is setto 2 for all blocks and a CCLM parameter calculation is performedthrough the reference sample selection method of the present embodimentproposed in FIG. 8 described above, cclm_reduced_sample_flag of value 0(false) is transmitted.

2) In the case that encoding efficiency is good when it is configuredthat method 1 is applied and a CCLM parameter calculation is performedthrough the reference sample selection method of the present embodimentproposed, cclm_reduced_sample_flag of value 1 (true) is transmitted.

-   -   Alternatively, in the case that the information representing        whether the method of the present embodiment described above is        applied is transmitted in a unit of slice, picture or sequence,        the encoding apparatus may add a high level syntax (HLS) as        represented in Table 23, Table 24 or Table 25 described above        and transmit the information representing one method among the        methods. The encoding apparatus may configure the method applied        among the methods by considering a size of input image or in        accordance with an encoding target bitrate.

1) For example, in the case that an input image is HD quality or more,the encoding apparatus may apply method 3 (N_(th)=1, 2, 4 or 8), and inthe case that an input image is HD quality or less, the encodingapparatus may apply method 1 (N_(th)=1, 2 or 4).

2) In the case that image encoding of high quality is required, theencoding apparatus may apply method 3 (N_(th)=1, 2, 4 or 8), and in thecase that image encoding of normal quality is required, the encodingapparatus may apply method 2 (N_(th)=1, 2, 2 or 4) or method 1(N_(th)=1, 2 or 4).

The method proposed in the present embodiment may be used for a CCLMmode which is an intra-prediction mode for a chroma component, and thechroma block predicted through the CCLM mode may be used for deriving aresidual image through a differential from an original image in theencoding apparatus or used for reconstructed image through an additionwith a residual signal in the decoding apparatus.

FIGS. 14a and 14b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 1 of the present embodiment described above.

Referring to FIG. 14a , the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S1400). Forexample, the CCLM parameter may be calculated as the present embodimentshown in FIG. 14 b.

FIG. 14b may illustrate a specific embodiment of calculating the CCLMparameter. For example, referring to FIG. 14b , the encodingapparatus/decoding apparatus may determine whether the current chromablock is a square chroma block (step, S1405).

In the case that the current chroma block is a square chroma block, theencoding apparatus/decoding apparatus may set a width or a height of thecurrent block to N (step, S1410) and determine whether a size of thecurrent chroma block is 2×2 (step, S1415).

Alternatively, in the case that the current chroma block is not a squarechroma block, a size of the current chroma block may be derived in M×Nsize or N×M size (step, S1420). The encoding apparatus/decodingapparatus determine whether a size of the current chroma block is 2×2(step, S1415). Here, the M represents a value greater than the N (N<M).

In the case that a size of the current chroma block is 2×2, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1425). Here, the N_(th) may be 1(N_(th)=1).

The encoding apparatus/decoding apparatus may derive parameters α and βfor the CCLM prediction based on the selected reference samples (step,S1430).

Meanwhile, in the case that a size of the current chroma block is not2×2, the encoding apparatus/decoding apparatus determine whether the Nis 2 (N==2) (step, S1435).

In the case that the N is 2, the encoding apparatus/decoding apparatusmay select 2N_(th) neighboring samples in a reference line adjacent tothe current block as a reference sample for the CCLM parametercalculation (step, S1440). Here, the N_(th) may be 2 (N_(th)=2). Later,the encoding apparatus/decoding apparatus may derive the parameters αand β for the CCLM prediction based on the selected reference samples(step, S1430).

Alternatively, in the case that the N is not 2, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1445). Here, the N_(th) may be 4(N_(th)=4). Later, the encoding apparatus/decoding apparatus may derivethe parameters α and β for the CCLM prediction based on the selectedreference samples (step, S1430).

Referring to FIG. 14a again, in the case that the parameters for CCLMprediction for the current chroma block is calculated, the encodingapparatus/decoding apparatus may perform the CCLM prediction based onthe parameters and generate a prediction sample for the current chromablock (step, S1450). For example, the encoding apparatus/decodingapparatus may generate a prediction sample for the current chroma blockbased on the calculated parameters and Equation 1 described above inwhich reconstructed samples of the current luma block for the currentchroma block.

FIGS. 15a and 15b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 2 of the present embodiment described above.

Referring to FIG. 15a , the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S1500). Forexample, the CCLM parameter may be calculated as the present embodimentshown in FIG. 15 b.

FIG. 15b may illustrate a specific embodiment of calculating the CCLMparameter. For example, referring to FIG. 15b , the encodingapparatus/decoding apparatus may determine whether the current chromablock is a square chroma block (step, S1505).

In the case that the current chroma block is a square chroma block, theencoding apparatus/decoding apparatus may set a width or a height of thecurrent block to N (step, S1510) and determine whether a size of thecurrent chroma block is 2×2 (step, S1515).

Alternatively, in the case that the current chroma block is not a squarechroma block, a size of the current chroma block may be derived in M×Nsize or N×M size (step, S1520). The encoding apparatus/decodingapparatus determine whether a size of the current chroma block is 2×2(step, S1515). Here, the M represents a value greater than the N (N<M).

In the case that a size of the current chroma block is 2×2, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1525). Here, the N_(th) may be 1(N_(th)=1).

The encoding apparatus/decoding apparatus may derive parameters α and βfor the CCLM prediction based on the selected reference samples (step,S1530).

Meanwhile, in the case that a size of the current chroma block is not2×2, the encoding apparatus/decoding apparatus determine whether the Nis 2 (N==2) (step, S1535).

In the case that the N is 2, the encoding apparatus/decoding apparatusmay select 2N_(th) neighboring samples in a reference line adjacent tothe current block as a reference sample for the CCLM parametercalculation (step, S1540). Here, the N_(th) may be 2 (N_(th)=2). Later,the encoding apparatus/decoding apparatus may derive the parameters αand β for the CCLM prediction based on the selected reference samples(step, S1530).

Meanwhile, in the case that the N is not 2, the encodingapparatus/decoding apparatus may determine whether the N is 4 (N==4)(step, S1545).

In the case that the N is 4, the encoding apparatus/decoding apparatusmay select 2N_(th) neighboring samples in a reference line adjacent tothe current block as a reference sample for the CCLM parametercalculation (step, S1550). Here, the N_(th) may be 2 (N_(th)=2). Later,the encoding apparatus/decoding apparatus may derive the parameters αand β for the CCLM prediction based on the selected reference samples(step, S1530).

Alternatively, in the case that the N is not 4, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1555). Here, the N_(th) may be 4(N_(th)=4). Later, the encoding apparatus/decoding apparatus may derivethe parameters α and β for the CCLM prediction based on the selectedreference samples (step, S1530).

Referring to FIG. 15a again, in the case that the parameters for CCLMprediction for the current chroma block is calculated, the encodingapparatus/decoding apparatus may perform the CCLM prediction based onthe parameters and generate a prediction sample for the current chromablock (step, S1560). For example, the encoding apparatus/decodingapparatus may generate a prediction sample for the current chroma blockbased on the calculated parameters and Equation 1 described above inwhich reconstructed samples of the current luma block for the currentchroma block.

FIGS. 16a and 16b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 3 of the present embodiment described above.

Referring to FIG. 16a , the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S1600). Forexample, the CCLM parameter may be calculated as the present embodimentshown in FIG. 16 b.

FIG. 16b may illustrate a specific embodiment of calculating the CCLMparameter. For example, referring to FIG. 16b , the encodingapparatus/decoding apparatus may determine whether the current chromablock is a square chroma block (step, S1605).

In the case that the current chroma block is a square chroma block, theencoding apparatus/decoding apparatus may set a width or a height of thecurrent block to N (step, S1610) and determine whether a size of thecurrent chroma block is 2×2 (step, S1615).

Alternatively, in the case that the current chroma block is not a squarechroma block, a size of the current chroma block may be derived in M×Nsize or N×M size (step, S1620). The encoding apparatus/decodingapparatus determine whether a size of the current chroma block is 2×2(step, S1615). Here, the M represents a value greater than the N (N<M).

In the case that a size of the current chroma block is 2×2, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1625). Here, the N_(th) may be 1(N_(th)=1).

The encoding apparatus/decoding apparatus may derive parameters α and βfor the CCLM prediction based on the selected reference samples (step,S1630).

Meanwhile, in the case that a size of the current chroma block is not2×2, the encoding apparatus/decoding apparatus determine whether the Nis 2 (N==2) (step, S1635).

In the case that the N is 2, the encoding apparatus/decoding apparatusmay select 2N_(th) neighboring samples in a reference line adjacent tothe current block as a reference sample for the CCLM parametercalculation (step, S1640). Here, the N_(th) may be 2 (N_(th)=2). Later,the encoding apparatus/decoding apparatus may derive the parameters αand β for the CCLM prediction based on the selected reference samples(step, S1630).

Meanwhile, in the case that the N is not 2, the encodingapparatus/decoding apparatus may determine whether the N is 4 (N==4)(step, S1645).

In the case that the N is 4, the encoding apparatus/decoding apparatusmay select 2N_(th) neighboring samples in a reference line adjacent tothe current block as a reference sample for the CCLM parametercalculation (step, S1650). Here, the N_(th) may be 4 (N_(th)=4). Later,the encoding apparatus/decoding apparatus may derive the parameters αand β for the CCLM prediction based on the selected reference samples(step, S1630).

Alternatively, in the case that the N is not 4, the encodingapparatus/decoding apparatus may select 2N_(th) neighboring samples in areference line adjacent to the current block as a reference sample forthe CCLM parameter calculation (step, S1655). Here, the N_(th) may be 8(N_(th)=8). Later, the encoding apparatus/decoding apparatus may derivethe parameters α and β for the CCLM prediction based on the selectedreference samples (step, S1630).

Referring to FIG. 16a again, in the case that the parameters for CCLMprediction for the current chroma block is calculated, the encodingapparatus/decoding apparatus may perform the CCLM prediction based onthe parameters and generate a prediction sample for the current chromablock (step, S1660). For example, the encoding apparatus/decodingapparatus may generate a prediction sample for the current chroma blockbased on the calculated parameters and Equation 1 described above inwhich reconstructed samples of the current luma block for the currentchroma block.

Meanwhile, in the case that subsampling is required in deriving aneighboring reference sample for a CCLM parameter calculation, thepresent disclosure proposes an embodiment of selecting a subsamplingsample more efficiently.

FIG. 17 illustrates an example of selecting a neighboring referencesample of a chroma block.

Referring to (a) of FIG. 17, in a chroma block of 2×2 size (N=2), CCLMparameters α and β for the chroma block may be calculated based on 4neighboring reference samples. The neighboring reference samples mayinclude 4 neighboring reference samples of the luma block and 4neighboring reference samples of the chroma block. In addition, like thepresent embodiments described above, in the case that N_(th) for thechroma block of 2×2 size is set to 1 (N_(th)=1), referring to (b) ofFIG. 17, CCLM parameters α and β for the chroma block may be calculatedbased on 2 neighboring reference samples. However, as shown in FIG. 17,in the case of using neighboring reference samples which are sub-sampledin a half, since the neighboring reference samples are crowded in a topright side of the current chroma block, a problem occurs that diversityof neighboring reference samples is not considered in CCLM parametercalculation, which may be a cause of CCLM parameter accuracydegradation.

FIGS. 18a to 18c illustrates neighboring reference samples derivedthrough the existing subsampling and neighboring reference samplesderived through subsampling according to the present embodiment.

As shown in FIG. 18a and FIG. 18b , a neighboring sample which is farfrom a top left side of the current chroma block is preferentiallyselected through the subsampling according to the present embodiment,more diverse sample values may be selected in CCLM parametercalculation.

In addition, as shown in FIG. 18c , the present embodiment proposessubsampling that selects a side far from a top left side preferentiallyeven for a non-square chroma block like n×2 size or 2×n size. Throughthis, more diverse sample values may be selected in CCLM parametercalculation, and through this, CCLM parameter calculation accuracy maybe improved.

Meanwhile, the existing subsampling may be performed based on thefollowing equation.

Idx_w=(x*width)/subsample_num

Idx_h=(y*height)/subsample_num  [Equation 5]

Here, Idx_w may represent a neighboring reference sample (or position ofneighboring reference sample) adjacent to a top current chroma blockwhich is derived through subsampling, and Idx_h may represent aneighboring reference sample (or position of neighboring referencesample) adjacent to a left current chroma block which is derived throughsubsampling. Further, width may represent a width of the current chromablock, and height may represent a height of the current chroma block. Inaddition, subsample_num may represent the number of neighboringreference samples (the number of neighboring reference samples adjacentto a side) which is derived through subsampling.

For example, the subsampling performed based on Equation 5 above may beperformed as below.

x of Equation 5 above is a variable and may be increased from 0 to areference sample number of top neighboring reference samples of thecurrent chroma block after subsampling. As an example, in the case that2 top neighboring reference samples are selected in the current chromablock of which width is 16, the width of Equation 5 is 16, and x mayvary from 0 to 1. In addition, since the Subsample_num is 2, 0 and 8 maybe selected as the ldx_w value. Accordingly, in the case that xcomponent and y component of a top left sample position of the currentchroma block are 0, the top neighboring reference sample of which xcoordinate is 0 and top the neighboring reference sample of which xcoordinate is 8 may be selected among the top neighboring referencesamples through the subsampling.

y of Equation 5 above is a variable and may be increased from 0 to areference sample number of left neighboring reference samples of thecurrent chroma block after subsampling. As an example, in the case that4 left neighboring reference samples are selected in the current chromablock of which height is 32, the height of Equation 5 is 32, and y mayvary from 0 to 3. In addition, since the Subsample_num is 4, 0, 8, 16and 24 may be selected as the ldx_h value. Accordingly, in the case thatx component and y component of a top left sample position of the currentchroma block are 0, the left neighboring reference sample of which ycoordinate is 0, the left neighboring reference sample of which ycoordinate is 8, the left neighboring reference sample of which ycoordinate is 16 and the left neighboring reference sample of which ycoordinate is 24 may be selected among the left neighboring referencesamples through the subsampling.

Referring to Equation 5 above, only the samples near to the top left ofthe current chroma block may be selected through the subsampling.

Therefore, according to the present embodiment, subsampling may beperformed based on an equation different from Equation 5 above. Forexample, the subsampling proposed in the present embodiment may beperformed based on the following equation.

Idx_w=width−1−(x*width)/subsample_num_width

Idx_h=height−1−(y*height)/subsample_num_height  [Equation 6]

Herein, subsample_num_width may represent a top neighboring referencesample number derived through subsampling, and subsample_num_height mayrepresent a left neighboring reference sample number derived throughsubsampling.

In addition, x is a variable and may be increased from 0 to a referencesample number of top neighboring reference samples of the current chromablock after subsampling. Further, y is a variable and may be increasedfrom 0 to a reference sample number of left neighboring referencesamples of the current chroma block after subsampling.

For example, referring to Equation 6 above, in the case that 2 topneighboring reference samples are selected in the current chroma blockof which width is 16, the width of Equation 6 is 16, and x may vary from0 to 1. In addition, since the subsample_num_width is 2, 15 and 7 may beselected as the ldx_w value. Accordingly, in the case that x componentand y component of a top left sample position of the current chromablock are 0, the top neighboring reference sample of which x coordinateis 15 and top the neighboring reference sample of which x coordinate is7 may be selected among the top neighboring reference samples throughthe subsampling. That is, among the top neighboring reference samples ofthe current chroma block, the top neighboring reference sample which isfar from the top left side of the current chroma block may be selected.

In addition, for example, referring to Equation 6 above, in the casethat 4 left neighboring reference samples are selected in the currentchroma block of which height is 32, the height of Equation 6 is 32, andy may vary from 0 to 3. In addition, since the subsample_num_height is4, 31, 23, 15 and 7 may be selected as the ldx_h value. Accordingly, inthe case that x component and y component of a top left sample positionof the current chroma block are 0, the left neighboring reference sampleof which y coordinate is 31, the left neighboring reference sample ofwhich y coordinate is 23, the left neighboring reference sample of whichy coordinate is 15 and the left neighboring reference sample of which ycoordinate is 7 may be selected among the left neighboring referencesamples through the subsampling.

Meanwhile, the subsample_num_width and the subsample_num_height ofEquation 6 above may be derived based on a size of the current chromablock. For example, the subsample_num_width and the subsample_num_heightmay be derived as represented in the following table.

TABLE 27 (subsample_num_width, Chroma block size subsample_num_height) 2× 2, 2 × N, N × 2 (N > 2) (2, 2) 4 × 4, 4 × N, N × 4 (N > 4) (4, 4) 8 ×8, 8 × N, N × 8 (N > 8) (8, 8) 16 × 16, 16 × N, N × 16 (16, 16) (N > 16)32 × 32, 32 × N, N × 32 (32, 32) (N > 32) 64 × 64 (64, 64)

Referring to Table 27, subsampling may be performed for neighboringreference samples adjacent to a long side in accordance with a shortside between a width and a height of the current chroma block. That is,the number of neighboring reference samples selected among theneighboring reference samples adjacent to a long side may be derived asa smaller value between a width and a height of the current chromablock. For example, it may be derived assubsample_num_width=subsample_num_height=min (width, height).

Alternatively, for example, in the case that the N_(th) is derived, thesubsample_num_width and the subsample_num_height may be derived based onthe N_(th). For example, the subsample_num_width and thesubsample_num_height may be derived as represented in the followingtable based on the N_(th).

TABLE 28 subsample_num_width = min(width, height) if N_(th) >= width subsample_num_width = min(N_(th), height) if N_(th) < widthsubsample_num_height = min(width, height) if N_(th) >= height subsample_num_height = min(N_(th), width) if N_(th) < height

Herein, min (A, B) may represent a smaller value between A and B.

Alternatively, for example, based on a predetermined look-up table(LUT), subsampling may be performed for deriving an optimal number ofneighboring reference samples in accordance with a shape of the currentchroma block. For example, the LUT may be derived as represented in thefollowing table.

TABLE 29 (subsample_num_width, Chroma block size subsample_num_height) 2× 2, 2 × 4, 2 × 8, 2 × 16, 2 × 32 (2, 2), (2, 2), (2, 6), (2, 14), (2,30) 4 × 2, 8 × 2, 16 × 2, 32 × 2 (2, 2), (6, 2), (14, 2), (30, 2) 4 × 4,4 × 8, 4 × 16, 4 × 32 (4, 4), (4, 4), (4, 12), (4, 28) 8 × 4, 16 × 4, 32× 4 (4, 4), (12, 4), (28, 4) 8 × 8, 8 × 16, 8 × 32 (8, 8), (8, 8), (8,24) 16 × 8, 32 × 8 (8, 8), (24, 8) 16 × 16, 16 × 32 (16, 16), (16, 16)32 × 16 (16, 16) 32 × 32 (32, 32)

Referring to Table 29 above, the selected number of neighboringreference samples may be increased in comparison with the subsamplingdescribed above, and through this, a CCLM parameter may be calculated inhigher accuracy. In subsampling for deriving 6 neighboring referencesamples in the example described above, first 6 positions (idx_w oridx_h) may be selected among subsampling for deriving 8 neighboringreference samples, and in subsampling for deriving 12 or 14 neighboringreference samples, first 12 or 14 positions may be selected amongsubsampling for deriving 16 neighboring reference samples. In addition,in subsampling for deriving 24 or 28 neighboring reference samples,first 24 or 28 positions may be selected among subsampling for deriving32 neighboring reference samples.

Alternatively, in order to prevent increase of hardware complexity,subsampling for deriving simplified number of neighboring referencesamples may be performed. For example, the LUT may be derived asrepresented in the following table.

TABLE 30 (subsample_num_width, Chroma block size subsample_num_height) 2× 2, 2 × 4, 2 × 8, 2 × 16, 2 × 32 (2, 2), (2, 2), (2, 6), (2, 6), (2, 6)4 × 2, 8 × 2, 16 × 2, 32 × 2 (2, 2), (6, 2), (6, 2), (6, 2) 4 × 4, 4 ×8, 4 × 16, 4 × 32 (4, 4), (4, 4), (2, 6), (2, 6) 8 × 4, 16 × 4, 32 × 4(4, 4), (6, 2), (6, 2) 8 × 8, 8 × 16, 8 × 32 (4, 4), (4, 4), (2, 6) 16 ×8, 32 × 8 (4, 4), (6, 2) 16 × 16, 16 × 32 (4, 4), (4, 4) 32 × 16 (4, 4)32 × 32 (4, 4)

Referring to Table 30 above, a maximum value of summation of thesubsample_num_width and the subsample_num_height may set to 8. Throughthis, hardware complexity may be reduced, and simultaneously, a CCLMparameter may be calculated efficiently.

In subsampling for deriving 6 neighboring reference samples in theexample described above, first 6 positions (idx_w or idx_h) may beselected among subsampling for deriving 8 neighboring reference samples.

According to the proposed method, without need to transmit additionalinformation, a value promised in an encoder or a decoder may be used, orit may be transmitted whether to use the proposed method or a value in aunit of CU, slice, picture and sequence.

In the case that the subsampling using the LUT as represented in Table29 and Table 30 described above is performed, the encoding apparatus andthe decoding apparatus may use the subsample_num_width andsubsample_num_height numbers determined in the Table (i.e., LUT), and inthe case that the N_(th) is used, the subsample_num_width and thesubsample_num_height may be determined based on the N_(th) value. Inaddition, in the other cases, the value derived as Table 28 may be usedas a default subsample_num_width and a subsample_num_height number.

Meanwhile, in the case that the proposed method is transmitted in a unitof CU, that is, the information representing whether to applysubsampling using Equation 6 described above is transmitted, a methodfor the decoding apparatus to perform a CCLM prediction by parsingcclm_subsample_flag as below, when an intra-prediction mode of thecurrent chroma block is the CCLM mode.

-   -   In the case that the cclm_subsample_flag is 0 (false), a        neighboring reference sample selection and a CCLM parameter        calculation are performed through the existing subsampling        method (subsampling based on Equation 5 described above).    -   In the case that the cclm_subsample_flag is 1 (true), a        neighboring reference sample selection and a CCLM parameter        calculation are performed through the proposed subsampling        method (subsampling based on Equation 6 described above).

In the case that the information representing whether to use theproposed method is transmitted in in a unit of slice, picture andsequence, the information may be transmitted through high level syntax(HLS) as below. The decoding apparatus may select a subsampling methodwhich is performed based on the information.

For example, the information representing whether to use the proposedmethod signaled through a slice header may be represented as thefollowing Table.

TABLE 31 slice_header( ) { Descriptor  . . .  cclm_subsample_flag f(1) .. .

cclm_reduced_sample_flag may represent a syntax element of theinformation representing whether to use the proposed method.

Alternatively, for example, the information representing whether to usethe proposed method signaled through a Picture Parameter Set (PPS) maybe represented as the following table.

TABLE 32 pic_parameter_set_rbsp( ) { Descriptor  . . . cclm_subsample_flag f(1) . . .

Alternatively, for example, the information representing whether to usethe proposed method signaled through a Sequence Parameter Set (SPS) maybe represented as the following table.

TABLE 33 sps_parameter_set_rbsp( ) { Descriptor  . . . cclm_subsample_flag f(1) . . .

The method selected based on cclm_reduced_sample_flag value (i.e., avalue derived by decoding cclm_reduced_sample_flag) transmitted throughthe slice header, the PPS or the SPS may be derived as represented inthe following table.

TABLE 34 cclm_subsample_flag Proposed method 0 Not apply (Use Equation5) 1 Apply (Use Equation 6)

Referring to Table. 34, in the case that the cclm_reduced_sample_flagvalue is 0, the subsampling using Equation 5 may be performed, and inthe case that the cclm_reduced_sample_flag value is 1, the subsamplingusing Equation 6 may be performed.

Meanwhile, in the case that a predetermined value is used in theencoding apparatus and the decoding apparatus without transmitting theadditional information, the encoding apparatus may perform theembodiment described above in the same manner of the decoding apparatusand perform a CCLM parameter calculation based on the selectedneighboring reference samples.

Alternatively, in the case that the information representing whether toapply the proposed subsampling method is transmitted in a unit of CU,slice, picture and sequence, the encoding apparatus may determinewhether to apply the proposed subsampling method, and then, transmitinformation of the determined method to the decoding apparatus.

-   -   In the case that the information representing whether to apply        the proposed subsampling method is transmitted in a unit of CU,        when an intra-prediction mode of the current chroma block is        CCLM mode, the encoding apparatus may determine a side of good        encoding efficiency between two following cases through RDO and        transmit information of the value representing the corresponding        case to the decoding apparatus.

1) In the case that encoding efficiency is good when a CCLM parametercalculation are performed through the existing subsampling (subsamplingbased on Equation 5 described above), cclm_reduced_sample_flag of value0 (false) is transmitted.

2) In the case that encoding efficiency is good when a CCLM parametercalculation are performed through the proposed subsampling (subsamplingbased on Equation 5 described above), cclm_reduced_sample_flag of value1 (true) is transmitted.

-   -   In the case that the information representing whether to apply        the proposed subsampling method is transmitted in a unit of        slice, picture or sequence, the encoding apparatus may add a        high level syntax (HLS) as represented in Table 31, Table 32 or        Table 33 described above and transmit the information.

FIG. 19 illustrates an example of performing a CCLM prediction usingsubsampling using Equation 6 described above.

Referring to FIG. 19, the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S1900).

Particularly, the encoding apparatus/decoding apparatus may determinewhether subsampling for neighboring samples of the current chroma blockis required (step, S1905).

For example, in order to derive CCLM parameters for the current chromablock, in the case that top neighboring samples of a smaller number thanthat of a width of the current chroma block are selected, it is requiredto perform the subsampling for top neighboring samples of the currentchroma block. In addition, for example, in order to derive CCLMparameters for the current chroma block, in the case that topneighboring samples of a smaller number than that of a height of thecurrent chroma block are selected, it is required to perform thesubsampling for left neighboring samples of the current chroma block.

In the case that the subsampling is required, the encodingapparatus/decoding apparatus may select a specific number of neighboringsamples by performing subsampling using Equation 6 for the neighboringsamples (step, S1910). Later, the encoding apparatus/decoding apparatusmay calculate CCLM parameters for the current chroma block based on theselected neighboring samples (step, S1915).

In the case that the subsampling is not required, the encodingapparatus/decoding apparatus may not perform the subsampling but selectthe neighboring samples of the current chroma block (step, S1920).Later, the encoding apparatus/decoding apparatus may calculate the CCLMparameters for the current chroma block based on the selectedneighboring samples (step, S1915).

In the case that the CCLM parameters are derived, the encodingapparatus/decoding apparatus may generate a prediction sample of thecurrent chroma block by performing a CCLM prediction for the currentchroma block based on the CCLM parameters (step, S1925).

Meanwhile, in the present disclosure, in deriving the CCLM parameter, anembodiment which is different from the present embodiment of reducingoperation complexity for deriving the CCLM parameter may be proposed.

In order to solve the problem of increase of CCLM parameter operationamount as the chroma block size increase described above, the presentembodiment proposes a method of configuring a pixel selection upperlimit N_(th) adaptively. The N_(th) may also be referred to as a maximumneighboring sample number.

In addition, in the case that N=2 (here, N is a smaller value between awidth and a height of a chroma block), in order to prevent the worstcase operation (a case CCLM prediction is performed for all chromablocks, after all chroma blocks in a CTU is divided into 2×2 size)occurred in CCLM prediction for a chroma block of 2×2 size, the presentembodiment proposes a method of configuring N_(th) adaptively, andthrough this, an amount of operation for CCLM parameter calculation inthe worst cast may be reduced by about 50%.

For example, according to the present embodiment, the N_(th) may beconfigured to a block size adaptively as below.

-   -   Method 1 in the present embodiment (proposed method 1)    -   In the case that N=2 in the current chroma block of N×M size or        M×N size, N_(th) may be set to 1 (N_(th)=1).    -   In the case that N=4 in the current chroma block of N×M size or        M×N size, N_(th) may be set to 2 (N_(th)=2).    -   In the case that N>4 in the current chroma block of N×M size or        M×N size, N_(th) may be set to 4 (N_(th)=4).

Alternatively, for example, according to the present embodiment, theN_(th) may be configured to a block size adaptively as below.

-   -   Method 2 in the present embodiment (proposed method 2)    -   In the case that N=2 in the current chroma block of N×M size or        M×N size, N_(th) may be set to 1 (N_(th)=1).    -   In the case that N=4 in the current chroma block of N×M size or        M×N size, N_(th) may be set to 2 (N_(th)=2).

Alternatively, for example, according to the present embodiment, theN_(th) may be configured to a block size adaptively as below.

-   -   Method 3 in the present embodiment (proposed method 3)    -   In the case that N>4 in the current chroma block of N×M size or        M×N size, N_(th) may be set to 4 (N_(th)=4).

Alternatively, for example, according to the present embodiment, theN_(th) may be configured to a block size adaptively as below.

-   -   Method 4 in the present embodiment (proposed method 4)    -   In the case that N>2 in the current chroma block of N×M size or        M×N size, N_(th) may be set to 2 (N_(th)=2).

In the present embodiment, the case that N=2 may represent the case thatthe neighboring sample number for CCLM parameter calculation is 4 (i.e.,2N), and the case that N_(th)=1 may represent the case that only 2(i.e., 2N_(th)) neighboring samples are used for CCLM parametercalculation. Further, the case that N=4 may represent the case that theneighboring sample number for CCLM parameter calculation is 8 (i.e.,2N), and the case that N_(th)=2 may represent the case that only 4(i.e., 2N_(th)) neighboring samples are used for CCLM parametercalculation.

Therefore, according to method 1 above, in the case that 4 neighboringsamples may be used for CCLM prediction (e.g., the case that theexisting CCLM prediction mode (i.e., LM_LA mode) is applied to thechroma block of 2×N size or N×2 size, the case that LM_A mode is appliedto the chroma block of 2×N size and the case that LM_L mode is appliedto the chroma block of N×2 size), a CCLM parameter is calculated byusing only a half of neighboring samples, and accordingly, an amount ofcomparison operation may be reduced to a half in the worst case. Inaddition, even in the case that 8 neighboring samples may be used forCCLM prediction (e.g., the case that the existing CCLM prediction mode(i.e., LM_LA mode) is applied to the chroma block of 4×N size or N×4size, the case that LM_A mode is applied to the chroma block of 4×N sizeand the case that LM_L mode is applied to the chroma block of N×4 size),a CCLM parameter is calculated by using only a half of neighboringsamples, an amount of comparison operation may be reduced significantly.Further, even for the case of using more neighboring samples, maximum 8neighboring samples only are used, and the CCLM parameter calculationmay be performed.

In addition, according to method 2 above, in the case that 4 neighboringsamples may be used for CCLM prediction (e.g., the case that theexisting CCLM prediction mode (i.e., LM_LA mode) is applied to thechroma block of 2×N size or N×2 size, the case that LM_A mode is appliedto the chroma block of 2×N size and the case that LM_L mode is appliedto the chroma block of N×2 size), a CCLM parameter is calculated byusing only a half of neighboring samples, and accordingly, an amount ofcomparison operation may be reduced to a half in the worst case.Further, even for the case of using more neighboring samples, maximum 4neighboring samples only are used, and the CCLM parameter calculationmay be performed.

Furthermore, according to method 3 above, maximum 8 neighboring samplesonly are used, and the CCLM parameter calculation may be performed, andaccording to method 4 above, maximum 4 neighboring samples only areused, and the CCLM parameter calculation may be performed. That is,according to method 4, the CCLM parameter may be calculated using 4neighboring blocks in all chroma blocks.

Method 1 to method 4 described above in the present embodiment mayreduce the comparison operation of the worst case of the case that N=2by about 50%, and since N_(th) may be adaptively applied to each chromablock size, encoding loss may be minimized.

As described in method 1 to method 4, according to the presentembodiment, N_(th) may be configured adaptively to a block size, andthrough this, a reference sample number for deriving an optimized CCLMparameter may be selected.

The encoding apparatus/decoding apparatus may set the upper limit N_(th)for neighboring sample selection, and then, calculate a CCLM parameterby selecting a chroma block neighboring sample as described above.

An amount of CCLM parameter calculation according to a chroma block sizein the case to which the present embodiment described above is appliedmay be represented as the following table.

TABLE 35 Number of comparison operations Proposed Proposed ProposedProposed Original method 1 method 2 method 3 method 4 Block size CCLM(N_(th) = 1, 2, 4) (N_(th) = 1, 2) (N_(th) = 4) (N_(th) = 2) N = 2 8 4 48 8 N = 4 16 8 8 16 8 N = 8 32 16 8 16 8 N = 16 64 16 8 16 8 N = 32 12816 8 16 8

As represented in Table 35 above, in the case that the methods proposedin the present embodiment is used, it is identified that an amount ofoperation required for the CCLM parameter calculation is not increaseeven a block size is increased.

Meanwhile, according to the present embodiment, without need to transmitadditional information, a promised value may be used in the encodingapparatus and the decoding apparatus, or it may be transmitted whetherto use the proposed method and information representing the N_(th) valuein a unit of CU, slice, picture and sequence.

For example, in the case that information representing whether to usethe proposed method is used in a unit of CU, when an intra-predictionmode of a current chroma block is CCLM mode (i.e., in the case that CCLMprediction is applied to the current chroma block),cclm_reduced_sample_flag may be parsed and the present embodimentdescribed above may be performed as below.

-   -   In the case that the cclm_reduced_sample_flag is 0 (false), it        is configured N_(th)=4 for all blocks, and a CCLM parameter        calculation is performed through the neighboring sample        selection method of the present embodiment proposed in FIG. 8        described above.    -   In the case that the cclm_reduced_sample_flag is 1 (true), a        CCLM parameter calculation is performed through method 2 of the        present embodiment described above.

Alternatively, in the case that the information representing the appliedmethod is transmitted in a unit of slice, picture or sequence, asdescribed below, the method among method 1 to method 4 may be selectedbased on the information transmitted through a high level syntax (HLS),and based on the selected method, the CCLM parameter may be calculated.

For example, the information representing the applied method signaledthrough a slice header may be represented as the following table.

TABLE 36 slice_header( ) { Descriptor  . . . cclm_reduced_sample_threshold f(2) . . .

cclm_reduced_sample_threshold may represent a syntax element of theinformation representing the applied method.

Alternatively, for example, the information representing the appliedmethod signaled through a Picture Parameter Set (PPS) may be representedas the following table.

TABLE 37 pic_parameter_set_rbsp( ) { Descriptor  . . . cclm_reduced_sample_threshold f(2) . . .

Alternatively, for example, the information representing the appliedmethod signaled through a Sequence Parameter Set (SPS) may berepresented as the following table.

TABLE 38 sps_parameter_set_rbsp( ) { Descriptor  . . . cclm_reduced_sample_threshold f(2) . . .

The method selected based on cclm_reduced_sample_threshold value (i.e.,a value derived by decoding cclm_reduced_sample_threshold) transmittedthrough the slice header, the PPS or the SPS may be derived asrepresented in the following table.

TABLE 39 cclm_reduced_sample_threshold Proposed method 0 1 (N_(th) = 1,2, 4) 1 2 (N_(th) = 1, 2) 2 3 (N_(th) = 4) 3 4 (N_(th) = 2)

Referring to Table. 39, in the case that thecclm_reduced_sample_threshold value is 0, method 1 may be selected asthe method applied to the current chroma block, in the case that thecclm_reduced_sample_threshold value is 1, method 2 may be selected asthe method applied to the current chroma block, in the case that thecclm_reduced_sample_threshold value is 2, method 3 may be selected asthe method applied to the current chroma block, and in the case that thecclm_reduced_sample_threshold value is 3, method 4 may be selected asthe method applied to the current chroma block.

The method proposed in the present embodiment may be used for the CCLMmode (LM_T mode, LM_T mode or LM_LT mode) which is an intra-predictionmode for the chroma component, and the chroma block predicted throughthe CCLM mode may be used for deriving a residual image through adifferential from an original image in the encoding apparatus or usedfor reconstructed image through an addition with a residual signal inthe decoding apparatus.

Meanwhile, the experimental result data of method 1 and method 2proposed in the embodiment described above may be as below.

The following table may represent the experimental result data of method1.

TABLE 40 All Intra Main10 Over VTM-3.0rc1 Y U V EncT DecT Class A1−0.05% −0.27% −0.43%  99% 99% Class A2   0.01%   0.05%   0.06% 100% 99%Class B   0.00% −0.24% −0.32%  99% 98% Class C −0.04% −0.05% −0.03%  97%91% Class E −0.02% −0.04% −0.06%  98% 95% Overall −0.02% −0.12% −0.17% 99% 96% Class D   0.02%   0.07%   0.00%  98% 97%

In addition, the following table may represent the experimental resultdata of method 2.

TABLE 41 All Intra Main10 Over VTM-3.0rc1 Y U V EncT DecT Class A1  0.01% −0.02% −0.13% 99% 99% Class A2   0.07%   0.42%   0.24% 98% 97%Class B   0.03% −0.10% −0.15% 98% 96% Class C −0.01%   0.17%   0.12% 98%93% Class E −0.02%   0.10% −0.02% 98% 97% Overall   0.02%   0.09%  0.00% 98% 96% Class D   0.03%   0.22%   0.25% 98% 99%

Table 40 and Table 41 may represent coding efficiency and operationcomplexity to which method 1 and method 2 are applied. In thisexperiment, an anchor is VTM3.0rc1, and this is All intra experimentalresult.

Referring to Table 40, when method 1 is applied, although an amount ofCCLM parameter calculation operation is reduced (N_(th)=1, 2 and 4),there is no encoding loss, but rather, slight performance gain may beobtained (e.g., performance gain of Y 0.02%, Cb 0.12%, Cr 0.17%).Furthermore, referring to Table 40, it is identified that encoding anddecoding complexity are decreased to 99% and 96%, respectively.

In addition, referring to Table 41, when method 2 is applied, althoughan amount of CCLM parameter calculation operation is reduced (N_(th)=1and 2), encoding efficiency is not different from that of the existingCCLM prediction, and it is identified that encoding and decodingcomplexity are decreased to 99% and 96%, respectively.

Meanwhile, in the case that the information representing one of themethods is transmitted in a unit of CU, slice, picture and sequence, theencoding apparatus may determine one of method 1 to method 4 andtransmit the information to the decoding apparatus as below.

-   -   In the case that the information representing whether the method        of the present embodiment described above is applied is        transmitted in a unit of CU, when an intra-prediction mode of        the current chroma block is CCLM mode (i.e., in the case that        the CCLM prediction (LM_T mode, LM_T mode or LM_LT mode) is        applied to the current chroma block), the encoding apparatus may        determine a side of good encoding efficiency between two        following cases through RDO and transmit information of the        determined method to the decoding apparatus.

1) In the case that encoding efficiency is good when the N_(th) is setto 4 for all blocks and a CCLM parameter calculation is performedthrough the reference sample selection method of the present embodimentproposed in FIG. 8 described above, cclm_reduced_sample_flag of value 0(false) is transmitted.

2) In the case that encoding efficiency is good when it is configuredthat method 2 is applied and a CCLM parameter calculation is performedthrough the reference sample selection method of the present embodimentproposed, cclm_reduced_sample_flag of value 1 (true) is transmitted.

-   -   Alternatively, in the case that the information representing        whether the method of the present embodiment described above is        applied is transmitted in a unit of slice, picture or sequence,        the encoding apparatus may add a high level syntax (HLS) as        represented in Table 36, Table 37 or Table 38 described above        and transmit the information representing one method among the        methods. The encoding apparatus may configure the method applied        among the methods by considering a size of input image or in        accordance with an encoding target bitrate.

1) For example, in the case that an input image is HD quality or more,the encoding apparatus may apply method 1 (N_(th)=1, 2 or 4), and in thecase that an input image is HD quality or less, the encoding apparatusmay apply method 2 (N_(th)=1 or 2).

2) In the case that image encoding of high quality is required, theencoding apparatus may apply method 3 (N_(th)=4), and in the case thatimage encoding of normal quality is required, the encoding apparatus mayapply method 4 (N_(th)=2).

The method proposed in the present embodiment may be used for a CCLMmode (LM_T mode, LM_T mode or LM_LT mode) which is an intra-predictionmode for a chroma component, and the chroma block predicted through theCCLM mode may be used for deriving a residual image through adifferential from an original image in the encoding apparatus or usedfor reconstructed image through an addition with a residual signal inthe decoding apparatus.

FIGS. 20a and 20b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 1 of the present embodiment described above.The CCLM prediction may represent the existing CCLM prediction, that is,CCLM prediction performed based on the LM_LT mode or CCLM predictionperformed based on the LM_T mode.

Referring to FIG. 20a , the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S2000). Forexample, the CCLM parameter may be calculated as the present embodimentshown in FIG. 20 b.

FIG. 20b may illustrate a specific embodiment of calculating the CCLMparameter. For example, referring to FIG. 20b , the encodingapparatus/decoding apparatus may set N based on a shape of the currentchroma block and a CCLM prediction mode of the current chroma block(step, S2005). In the case that the LM_LT mode is applied to the currentchroma block, a smaller value between a width and a height of thecurrent chroma block may be set to N. Further, for example, in the casethat the current chroma block is a non-square block of which width isgreater than a height, and the LM_T mode is applied to the currentchroma block, a width of the current chroma block may be set to N. Inaddition, for example, in the case that the current chroma block is anon-square block of which height is greater than a width, and the LM_Lmode is applied to the current chroma block, a height of the currentchroma block may be set to N.

Later, the encoding apparatus/decoding apparatus may determine whetherthe N is 2 (N=2) (step, S2010).

In the case that the N is 2, the encoding apparatus/decoding apparatusmay select 2 (i.e., 2N_(th)) neighboring samples in a reference lineadjacent to the current block as a reference sample for the CCLMparameter calculation (step, S2015). Here, the N_(th) may be 1(N_(th)=1).

The encoding apparatus/decoding apparatus may derive the parameters αand β for the CCLM prediction based on the selected reference samples(step, S2020).

Meanwhile, in the case that the N is not 2, the encodingapparatus/decoding apparatus may determine whether the N is 4 (N=4)(step, S2025).

In the case that the N is 4, the encoding apparatus/decoding apparatusmay select 4 (i.e., 2N_(th)) neighboring samples in a reference lineadjacent to the current block as a reference sample for the CCLMparameter calculation (step, S2030). Here, the N_(th) may be 2(N_(th)=2). Later, the encoding apparatus/decoding apparatus may derivethe parameters α and β for the CCLM prediction based on the selectedreference samples (step, S2020).

Alternatively, in the case that the N is not 4, the encodingapparatus/decoding apparatus may select 8 (i.e., 2N_(th)) neighboringsamples in a reference line adjacent to the current block as a referencesample for the CCLM parameter calculation (step, S2035). Here, theN_(th) may be 4 (N_(th)=4). Later, the encoding apparatus/decodingapparatus may derive the parameters α and β for the CCLM predictionbased on the selected reference samples (step, S2020).

Referring to FIG. 20a again, in the case that the parameters for CCLMprediction for the current chroma block is calculated, the encodingapparatus/decoding apparatus may perform the CCLM prediction based onthe parameters and generate a prediction sample for the current chromablock (step, S2040). For example, the encoding apparatus/decodingapparatus may generate a prediction sample for the current chroma blockbased on the calculated parameters and Equation 1 described above inwhich reconstructed samples of the current luma block for the currentchroma block.

FIGS. 21a and 21b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 2 of the present embodiment described above.The CCLM prediction may represent the existing CCLM prediction, that is,CCLM prediction performed based on the LM_LT mode or CCLM predictionperformed based on the LM_T mode.

Referring to FIG. 21a , the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S2100). Forexample, the CCLM parameter may be calculated as the present embodimentshown in FIG. 21 b.

FIG. 21b may illustrate a specific embodiment of calculating the CCLMparameter. For example, referring to FIG. 21b , the encodingapparatus/decoding apparatus may set N based on a shape of the currentchroma block and a CCLM prediction mode of the current chroma block(step, S2105). In the case that the LM_LT mode is applied to the currentchroma block, a smaller value between a width and a height of thecurrent chroma block may be set to N. Further, for example, in the casethat the current chroma block is a non-square block of which width isgreater than a height, and the LM_T mode is applied to the currentchroma block, a width of the current chroma block may be set to N. Inaddition, for example, in the case that the current chroma block is anon-square block of which height is greater than a width, and the LM_Lmode is applied to the current chroma block, a height of the currentchroma block may be set to N.

Later, the encoding apparatus/decoding apparatus may determine whetherthe N is 2 (N=2) (step, S2110).

In the case that the N is 2, the encoding apparatus/decoding apparatusmay select 2 (i.e., 2N_(th)) neighboring samples in a reference lineadjacent to the current block as a reference sample for the CCLMparameter calculation (step, S2115). Here, the N_(th) may be 1(N_(th)=1).

The encoding apparatus/decoding apparatus may derive the parameters αand β for the CCLM prediction based on the selected reference samples(step, S2120).

Meanwhile, in the case that the N is not 2, the encodingapparatus/decoding apparatus may select 4 (i.e., 2N_(th)) neighboringsamples in a reference line adjacent to the current block as a referencesample for the CCLM parameter calculation (step, S2125). Here, theN_(th) may be 2 (N_(th)=2). Later, the encoding apparatus/decodingapparatus may derive the parameters α and β for the CCLM predictionbased on the selected reference samples (step, S2120).

Referring to FIG. 21a again, in the case that the parameters for CCLMprediction for the current chroma block is calculated, the encodingapparatus/decoding apparatus may perform the CCLM prediction based onthe parameters and generate a prediction sample for the current chromablock (step, S2130). For example, the encoding apparatus/decodingapparatus may generate a prediction sample for the current chroma blockbased on the calculated parameters and Equation 1 described above inwhich reconstructed samples of the current luma block for the currentchroma block.

FIGS. 22a and 22b are diagrams for describing a procedure of performingCCLM prediction based on the CCLM parameters of the current chroma blockderived according to method 3 of the present embodiment described above.The CCLM prediction may represent the existing CCLM prediction, that is,CCLM prediction performed based on the LM_LT mode or CCLM predictionperformed based on the LM_T mode.

Referring to FIG. 22a , the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S2200). Forexample, the CCLM parameter may be calculated as the present embodimentshown in FIG. 22 b.

FIG. 22b may illustrate a specific embodiment of calculating the CCLMparameter. For example, referring to FIG. 22b , the encodingapparatus/decoding apparatus may set N based on a shape of the currentchroma block and a CCLM prediction mode of the current chroma block(step, S2205). In the case that the LM_LT mode is applied to the currentchroma block, a smaller value between a width and a height of thecurrent chroma block may be set to N. Further, for example, in the casethat the current chroma block is a non-square block of which width isgreater than a height, and the LM_T mode is applied to the currentchroma block, a width of the current chroma block may be set to N. Inaddition, for example, in the case that the current chroma block is anon-square block of which height is greater than a width, and the LM_Lmode is applied to the current chroma block, a height of the currentchroma block may be set to N.

Later, the encoding apparatus/decoding apparatus may determine whetherthe N is 2 (N=2) (step, S2210).

In the case that the N is 2, the encoding apparatus/decoding apparatusmay select 4 neighboring samples in a reference line adjacent to thecurrent block as a reference sample for the CCLM parameter calculation(step, S2215). That is, the CCLM parameter may be calculated usingreference samples in the reference line.

The encoding apparatus/decoding apparatus may derive the parameters αand β for the CCLM prediction based on the selected reference samples(step, S2220).

Meanwhile, in the case that the N is not 2, the encodingapparatus/decoding apparatus may select 8 (i.e., 2N_(th)) neighboringsamples in a reference line adjacent to the current block as a referencesample for the CCLM parameter calculation (step, S2225). Here, theN_(th) may be 4 (N_(th)=4). Later, the encoding apparatus/decodingapparatus may derive the parameters α and β for the CCLM predictionbased on the selected reference samples (step, S2220).

Referring to FIG. 22a again, in the case that the parameters for CCLMprediction for the current chroma block is calculated, the encodingapparatus/decoding apparatus may perform the CCLM prediction based onthe parameters and generate a prediction sample for the current chromablock (step, S2230). For example, the encoding apparatus/decodingapparatus may generate a prediction sample for the current chroma blockbased on the calculated parameters and Equation 1 described above inwhich reconstructed samples of the current luma block for the currentchroma block.

FIG. 23 is a diagram for describing a procedure of performing CCLMprediction based on the CCLM parameters of the current chroma blockderived according to method 4 of the present embodiment described above.The CCLM prediction may represent the existing CCLM prediction, that is,CCLM prediction performed based on the LM_LT mode or CCLM predictionperformed based on the LM_T mode.

Referring to FIG. 23, the encoding apparatus/decoding apparatus maycalculate a CCLM parameter for the current block (step, S2300).

For example, the encoding apparatus/decoding apparatus may select 4(i.e., 2N_(th)) neighboring samples in a reference line adjacent to thecurrent block as a reference sample for the CCLM parameter calculation(step, S2305). Here, the N_(th) may be 2 (N_(th)=2). Or, the N_(th) maybe 4 (N_(th)=4). Later, the encoding apparatus/decoding apparatus mayderive the parameters α and β for the CCLM prediction based on theselected reference samples (step, S2310).

In the case that the parameters for CCLM prediction for the currentchroma block is calculated, the encoding apparatus/decoding apparatusmay perform the CCLM prediction based on the parameters and generate aprediction sample for the current chroma block (step, S2320). Forexample, the encoding apparatus/decoding apparatus may generate aprediction sample for the current chroma block based on the calculatedparameters and Equation 1 described above in which reconstructed samplesof the current luma block for the current chroma block.

FIG. 24 schematically illustrates a video encoding method by theencoding apparatus according to the present disclosure. The method shownin FIG. 24 may be performed by the encoding apparatus shown in FIG. 2.In a specific example, steps S2400 to S2460 of FIG. 24 may be performedby the predictor of the encoding apparatus, and step S2470 may beperformed by the entropy encoder of the encoding apparatus. In addition,although it is not shown in the drawings, the process of deriving theresidual sample for the current chroma block based on the originalsample and the prediction sample for the current chroma block may beperformed by the subtractor of the encoding apparatus, the process ofderiving reconstructed samples for the current chroma block based on theresidual samples and the prediction samples for the current chroma blockmay be performed by the adder of the encoding apparatus, the process ofgenerating information for the residual for the current chroma blockbased on the residual sample may be performed by the transformer of theencoding apparatus, and the process of encoding information for theresidual may be performed by the entropy encoder of the encodingapparatus.

The encoding apparatus determines a CCLM prediction mode of the currentchroma block among a plurality of cross-component linear model (CCLM)prediction modes (step, S2400). For example, the encoding apparatus maydetermine an intra-prediction mode of the current chroma block based onRate-distortion cost (RD cost; or RDO). Here, the RD cost may be derivedbased on Sum of Absolute Difference (SAD). The encoding apparatus maydetermine one of the CCLM prediction modes as the intra-prediction modeof the current chroma block based on the RD cost. That is, the encodingapparatus may determine the CCLM prediction mode of the current chromablock among the CCLM prediction modes based on the RD cost.

In addition, the encoding apparatus may encode the prediction modeinformation that represents the intra-prediction mode of the currentchroma block, and the prediction mode information may be signaledthrough a bitstream. The syntax element representing the prediction modeinformation for the current chroma block may be intra_chroma_pred_mode.The video information may include the prediction mode information.

Further, the encoding apparatus may encode the index informationindicating the CCLM prediction mode of the current chroma block andsignal the index information through a bitstream. The prediction modeinformation may include the index information indicating the CCLMprediction mode of the current chroma block among the cross-componentlinear model (CCLM) prediction modes. Here, the CCLM prediction modesmay include a left top LM mode, a top LM mode and a left LM mode. Theleft top LM mode may represent the LM_LT mode described above, the leftLM mode may represent the LM_L mode described above, and the top LM modemay represent the LM_T mode described above. In addition, the encodingapparatus may encode the flag representing whether the CCLM predictionis applied to the current chroma block and signal the flag through abitstream. The prediction mode information may include the flagrepresenting whether the CCLM prediction is applied to the currentchroma block. For example, in the case that the CCLM prediction isapplied to the current chroma block, the CCLM prediction mode indicatedby the index information may be derived as the CCLM prediction mode forthe current chroma block.

The encoding apparatus derives a sample number of neighboring chromasamples of the current chroma block based on the CCLM prediction mode ofthe current chroma block, a size of the current chroma block and aspecific value (step, S2410).

Here, in the case that the CCLM prediction mode of the current chromablock is the left LM mode, the neighboring chroma samples may includeonly the left neighboring chroma samples of the current chroma block. Inaddition, in the case that the CCLM prediction mode of the currentchroma block is the top LM mode, the neighboring chroma samples mayinclude only the top neighboring chroma samples of the current chromablock. Furthermore, in the case that the CCLM prediction mode of thecurrent chroma block is the left top LM mode, the neighboring chromasamples may include the left neighboring chroma samples and the topneighboring chroma samples of the current chroma block.

For example, in the case that the CCLM prediction mode of the currentchroma block is the left LM mode, the encoding apparatus may derive thesample number based on a height of the current chroma block and thespecific value.

As an example, the encoding apparatus may derive the sample number ofthe neighboring chroma samples by comparing double of the height anddouble of the specific value. For example, in the case that double ofthe height of the current chroma block is greater than double of thespecific value, the sample number may be derived as double of thespecific value. Further, for example, in the case that double of theheight of the current chroma block is double of the specific value orless, the sample number may be derived as double of the height.

In addition, for example, in the case that the CCLM prediction mode ofthe current chroma block is the top LM mode, the encoding apparatus mayderive the sample number based on the width of the current chroma blockand the specific value.

As an example, the encoding apparatus may derive the sample number ofthe neighboring chroma samples by comparing double of the width anddouble of the specific value. For example, in the case that double ofthe width of the current chroma block is greater than double of thespecific value, the sample number may be derived as double of thespecific value. Further, for example, in the case that double of thewidth of the current chroma block is double of the specific value orless, the sample number may be derived as double of the width.

In addition, for example, in the case that the CCLM prediction mode ofthe current chroma block is the left LM mode, the encoding apparatus mayderive the sample number of the top neighboring chroma samples and theleft neighboring chroma samples by comparing the width and the heightwith the specific value.

For example, in the case that the width and the height of the currentchroma block are greater than the specific value, the sample number maybe derived as the specific value.

Further, for example, in the case that the width and the height of thecurrent chroma block are the specific value or less, the sample numbermay be derived as one value of the width and the height. As an example,the sample number may be derived as the smaller value of the width andthe height.

Meanwhile, the specific value may be derived for deriving the CCLMparameters of the current chroma block. Here, the specific value may bereferred to as a neighboring sample number upper limit or a maximumneighboring sample number. As an example, the specific value may bederived as 2. Or, the specific value may be derived as 4, 8 or 16.

In addition, for example, the specific value may be derived as apredetermined value. That is, the specific value may be derived as avalue which is promised between the encoding apparatus and the decodingapparatus. In other words, the specific value may be derived as apredetermined value for the current chroma block to which the CCLM modeis applied.

Alternatively, for example, the encoding apparatus may encodeinformation representing the specific value and signal the informationrepresenting the specific value through a bitmap. The video informationmay include the information representing the specific value. Theinformation representing the specific value may be signaled in a unit ofcoding unit (CU). Or, the information representing the specific valuemay be signaled in a unit of slice header, Picture Parameter Set (PPS)or Sequence Parameter Set (SPS). That is, the information representingthe specific value may be signaled with a slice header, a PictureParameter Set (PPS) or a Sequence Parameter Set (SPS).

Alternatively, for example, the encoding apparatus may encode flaginformation representing whether the number of neighboring referencesamples is derived based on the specific value and signal the flaginformation through a bitmap. The video information may include the flaginformation representing whether the number of neighboring referencesamples is derived based on the specific value. In the case that theflag information value is 1, the flag information may represent that thenumber of neighboring reference samples is derived based on the specificvalue, and in the case that the flag information value is 0, the flaginformation may represent that the number of neighboring referencesamples is not derived based on the specific value. In the case that theflag information value is 1, the prediction related information mayinclude information representing the specific value, and the specificvalue may be derived based on the information representing the specificvalue. The flag information and/or the information representing thespecific value may be signaled in a unit of coding unit (CU). Or, flaginformation and/or the information representing the specific value maybe signaled in a unit of slice header, Picture Parameter Set (PPS) orSequence Parameter Set (SPS). That is, the flag information and/or theinformation representing the specific value may be signaled with a sliceheader, a PPS or a SPS.

Alternatively, for example, the specific value may be derived based on asize of the current chroma block.

As an example, in the case that a smaller value between the width andthe height of the current chroma block is 2 or less, the specific valuemay be derived as 1, in the case that a smaller value between the widthand the height of the current chroma block is 4, the specific value maybe derived as 2, and in the case that a smaller value between the widthand the height of the current chroma block is greater than 4, thespecific value may be derived as 4.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is 2 or less, thespecific value may be derived as 1, in the case that a smaller valuebetween the width and the height of the current chroma block is 4, thespecific value may be derived as 2, in the case that a smaller valuebetween the width and the height of the current chroma block is 8, thespecific value may be derived as 4, and in the case that a smaller valuebetween the width and the height of the current chroma block is greaterthan 8, the specific value may be derived as 8.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is 2 or less, thespecific value may be derived as 1, and in the case that a smaller valuebetween the width and the height of the current chroma block is greaterthan 2, the specific value may be derived as 2.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is 2 or less, thespecific value may be derived as 1, and in the case that a smaller valuebetween the width and the height of the current chroma block is greaterthan 2, the specific value may be derived as 4.

In addition, as an example, in the case that a size of the currentchroma block is 2×2, the specific value may be derived as 1, in the casethat a smaller value between the width and the height of the currentchroma block is 2, the specific value may be derived as 2, and in thecase that a smaller value between the width and the height of thecurrent chroma block is greater than 2, the specific value may bederived as 4.

In addition, as an example, in the case that a size of the currentchroma block is 2×2, the specific value may be derived as 1, in the casethat a smaller value between the width and the height of the currentchroma block is 2, the specific value may be derived as 2, in the casethat a smaller value between the width and the height of the currentchroma block is 4, the specific value may be derived as 2, and in thecase that a smaller value between the width and the height of thecurrent chroma block is greater than 4, the specific value may bederived as 4.

In addition, as an example, in the case that a size of the currentchroma block is 2×2, the specific value may be derived as 1, in the casethat a smaller value between the width and the height of the currentchroma block is 2, the specific value may be derived as 2, in the casethat a smaller value between the width and the height of the currentchroma block is 4, the specific value may be derived as 4, and in thecase that a smaller value between the width and the height of thecurrent chroma block is greater than 4, the specific value may bederived as 4.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is 2, the specificvalue may be derived as 1, in the case that a smaller value between thewidth and the height of the current chroma block is 4, the specificvalue may be derived as 2, and in the case that a smaller value betweenthe width and the height of the current chroma block is greater than 4,the specific value may be derived as 4.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is 2, the specificvalue may be derived as 1, and in the case that a smaller value betweenthe width and the height of the current chroma block is 4, the specificvalue may be derived as 2.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is greater than 4, thespecific value may be derived as 4.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is greater than 2, thespecific value may be derived as 2.

In addition, as an example, the specific value may be derived based onwhether a smaller value between the width and the height of the currentblock is greater than a specific threshold value. For example, in thecase that a smaller value between the width and the height of thecurrent block is greater than a specific threshold value, the specificthreshold value may be derived as 4, in the case that a smaller valuebetween the width and the height of the current block is a specificthreshold value or less, the specific threshold value may be derived as2. The specific threshold value may be derived as a predetermined value.That is, the specific threshold value may be derived as a value which ispromised between the encoding apparatus and the decoding apparatus.Alternatively, for example, the encoding apparatus may encode the videoinformation including the prediction related information, and theprediction related information may include the information representingthe specific threshold value. In this case, the specific threshold valuemay be derived based on the information representing the specificthreshold value. For example, the derived specific threshold value maybe 4 or 8.

The encoding apparatus may derive the neighboring chroma samples of thesample number (step, S2420). The encoding apparatus may derive theneighboring chroma samples of the sample number.

For example, in the case that the CCLM prediction mode of the currentchroma block is the left top LM mode, the encoding apparatus may deriveleft neighboring chroma samples of the sample number and the topneighboring chroma samples of the sample number. Particularly, in thecase that a size of the current chroma block is N×M, the encodingapparatus may derive the top neighboring chroma samples of the samplenumber among N top neighboring chroma samples and derive the leftneighboring chroma samples of the sample number among N left neighboringchroma samples. Here, N may be equal to or smaller than M.

In addition, for example, in the case that the CCLM prediction mode ofthe current chroma block is the top LM mode, the encoding apparatus mayderive the top neighboring chroma samples of the sample number.Particularly, in the case that a size of the current chroma block isN×M, the encoding apparatus may derive the top neighboring chromasamples of the sample number among 2N top neighboring chroma samples.Here, N may be equal to or smaller than M.

In addition, for example, in the case that the CCLM prediction mode ofthe current chroma block is the left LM mode, the encoding apparatus mayderive the left neighboring chroma samples of the sample number.Particularly, in the case that a size of the current chroma block isM×N, the encoding apparatus may derive the left neighboring chromasamples of the sample number among 2N left neighboring chroma samples.Here, N may be equal to or smaller than M.

The encoding apparatus may derive down-sampled neighboring luma samplesand down-sampled luma samples of the current luma block (step, S2430).Here, the neighboring luma samples may correspond to the neighboringchroma samples. For example, the down-sampled neighboring luma samplesmay include down-sample top neighboring luma samples of the current lumablock corresponding to the top neighboring chroma samples anddown-sampled left neighboring luma samples of the current luma blockcorresponding to the left neighboring chroma samples.

That is, for example, the neighboring luma samples may includedown-sample top neighboring luma samples of the sample numbercorresponding to the top neighboring chroma samples and down-sampledleft neighboring luma samples of the sample number corresponding to theleft neighboring chroma samples.

Alternatively, for example, the down-sampled neighboring luma samplesmay include down-sample top neighboring luma samples of the current lumablock corresponding to the top neighboring chroma samples. That is, forexample, the neighboring luma samples may include down-sample topneighboring luma samples of the sample number corresponding to the topneighboring chroma samples.

Alternatively, for example, the down-sampled neighboring luma samplesmay include down-sampled left neighboring luma samples of the currentluma block corresponding to the left neighboring chroma samples. Thatis, for example, the neighboring luma samples may include down-sampledleft neighboring luma samples of the sample number corresponding to theleft neighboring chroma samples.

The encoding apparatus derives CCLM parameters based on the neighboringchroma samples and the down-sampled neighboring luma samples (step,S2440). The encoding apparatus may derive the CCLM parameters based onthe neighboring chroma samples and the down-sampled neighboring lumasamples. For example, the CCLM parameters may be derived based onEquation 3 described above. Alternatively, for example, the CCLMparameters may be derived based on Equation 4 described above.

The encoding apparatus derives prediction samples for the current chromablock based on the CCLM parameters and the down-sampled luma samples(step, S2450). The encoding apparatus may derive the prediction samplesfor the current chroma block based on the CCLM parameters and thedown-sampled luma samples. The encoding apparatus may apply the CCLMderived by the CCLM parameters to the own-sampled luma samples andgenerate prediction samples for the current chroma block. That is, theencoding apparatus may perform a CCLM prediction based on the CCLMparameters and generate prediction samples for the current chroma block.For example, the prediction samples may be derived based on Equation 1described above.

The encoding apparatus encodes video information including predictionmode information for the current chroma block (step, S2460). Theencoding apparatus may encode the video information including predictionmode information for the current chroma block and signal through abitstream. The prediction mode information may include a flagrepresenting whether the CCLM prediction is applied to the currentchroma block. Further, the prediction mode information may include indexinformation representing a CCLM prediction mode of the current chromablock.

In addition, for example, the video information may include informationrepresenting the specific value. In addition, for example, the videoinformation may include the information representing the specific value.In addition, for example, the video information may include flaginformation representing whether the number of neighboring referencesamples is derived based on the specific value.

Meanwhile, although it is not shown in the drawings, the encodingapparatus may derive residual samples for the current chroma block basedon the original samples and the prediction samples for the currentchroma block, generate information for residual for the current chromablock based on the residual samples, and encode the information for theresidual. The video information may include the information for theresidual. In addition, the encoding apparatus may generate reconstructedsamples for the current chroma block based on the prediction samples andthe residual samples for the current chroma block.

Meanwhile, the bitstream may be transferred to the decoding apparatusthrough a network or (digital) storage medium. Here, the network mayinclude a broadcasting network and/or a communication network, and thedigital storage medium may include various storage media such as USB,SD, CD, DVD, blue-ray, HDD, SSD, and the like.

FIG. 25 schematically illustrates the encoding apparatus performing theimage encoding method according to the present disclosure. The methodshown in FIG. 24 may be performed by the encoding apparatus shown inFIG. 25. In a specific example, the predictor of the encoding apparatusmay perform steps S2400 to S2450 of FIG. 24, and the entropy encoder ofthe encoding apparatus may perform step S2460 of FIG. 24. In addition,although it is not shown in the drawings, the process of deriving theresidual sample for the current chroma block based on the originalsample and the prediction sample for the current chroma block may beperformed by the subtractor of the encoding apparatus shown in FIG. 25,the process of deriving reconstructed samples for the current chromablock based on the residual samples and the prediction samples for thecurrent chroma block may be performed by the adder of the encodingapparatus shown in FIG. 25, the process of generating information forthe residual for the current chroma block based on the residual samplemay be performed by the transformer of the encoding apparatus shown inFIG. 25, and the process of encoding information for the residual may beperformed by the entropy encoder of the encoding apparatus shown in FIG.17.

FIG. 26 schematically illustrates a video decoding method by thedecoding apparatus according to the present disclosure. The method shownin FIG. 26 may be performed by the decoding apparatus shown in FIG. 3.In a specific example, step S2600 of FIG. 26 may be performed by theentropy decoder of the decoding apparatus, and steps S2610 to S2650 maybe performed by the predictor of the decoding apparatus, and step S1860may be performed by the adder of the decoding apparatus. In addition,although it is not shown in the drawings, the process of acquiringinformation for residual of the current block through a bitstream may beperformed by the entropy decoder of the decoding apparatus, and theprocess of deriving the residual sample for the current block based onthe residual information may be performed by the inverse transformer ofthe decoding apparatus.

The decoding apparatus obtains information including the prediction modeinformation for the current chroma block (step, S2600). The decodingapparatus may receive video information including the prediction modeinformation for the current chroma block. The prediction modeinformation may represent the intra-prediction mode of the currentchroma block. In addition, the syntax element representing theprediction mode information for the current chroma block may beintra_chroma_pred_mode. The video information may include the predictionmode information.

Further, the prediction mode information may include the indexinformation indicating the CCLM prediction mode of the current chromablock among the cross-component linear model (CCLM) prediction modes.The CCLM prediction modes may include a left top LM mode, a top LM modeand a left LM mode. The left top LM mode may represent the LM_LT modedescribed above, the left LM mode may represent the LM_L mode describedabove, and the top LM mode may represent the LM_T mode described above.In addition, the prediction mode information may include the flagrepresenting whether the CCLM prediction is applied to the currentchroma block. For example, in the case that the CCLM prediction isapplied to the current chroma block, the CCLM prediction mode indicatedby the index information may be derived as the CCLM prediction mode forthe current chroma block.

The decoding apparatus may derive one of a plurality of CCLM predictionmodes as the CCLM prediction mode for the current chroma block based onthe prediction mode information (step, S2610). The decoding apparatus anintra-prediction mode of the current chroma intra-prediction mode basedon the prediction mode information. For example, the prediction modeinformation may represent the CCLM prediction mode for the currentchroma block. For example, the CCLM prediction mode for the currentchroma block may be derived based on the index information. Among theplurality of CCLM prediction modes, the CCLM prediction mode indicatedby the index information may be derived as the CCLM prediction mode forthe current chroma block.

The decoding apparatus derives a sample number of neighboring chromasamples of the current chroma block based on the CCLM prediction mode ofthe current chroma block, a size of the current chroma block and aspecific value (step, S2620).

Here, in the case that the CCLM prediction mode of the current chromablock is the left LM mode, the neighboring chroma samples may includeonly the left neighboring chroma samples of the current chroma block. Inaddition, in the case that the CCLM prediction mode of the currentchroma block is the top LM mode, the neighboring chroma samples mayinclude only the top neighboring chroma samples of the current chromablock. Furthermore, in the case that the CCLM prediction mode of thecurrent chroma block is the left top LM mode, the neighboring chromasamples may include the left neighboring chroma samples and the topneighboring chroma samples of the current chroma block.

For example, in the case that the CCLM prediction mode of the currentchroma block is the left LM mode, the decoding apparatus may derive thesample number based on a height of the current chroma block and thespecific value.

As an example, the decoding apparatus may derive the sample number ofthe neighboring chroma samples by comparing double of the height anddouble of the specific value. For example, in the case that double ofthe height of the current chroma block is greater than double of thespecific value, the sample number may be derived as double of thespecific value. Further, for example, in the case that double of theheight of the current chroma block is double of the specific value orless, the sample number may be derived as double of the height.

In addition, for example, in the case that the CCLM prediction mode ofthe current chroma block is the top LM mode, the decoding apparatus mayderive the sample number based on the width of the current chroma blockand the specific value.

As an example, the decoding apparatus may derive the sample number ofthe neighboring chroma samples by comparing double of the width anddouble of the specific value. For example, in the case that double ofthe width of the current chroma block is greater than double of thespecific value, the sample number may be derived as double of thespecific value. Further, for example, in the case that double of thewidth of the current chroma block is double of the specific value orless, the sample number may be derived as double of the width.

In addition, for example, in the case that the CCLM prediction mode ofthe current chroma block is the left LM mode, the decoding apparatus mayderive the sample number of the top neighboring chroma samples and theleft neighboring chroma samples by comparing the width and the heightwith the specific value.

For example, in the case that the width and the height of the currentchroma block are greater than the specific value, the sample number maybe derived as the specific value.

Further, for example, in the case that the width and the height of thecurrent chroma block are the specific value or less, the sample numbermay be derived as one value of the width and the height. As an example,the sample number may be derived as the smaller value of the width andthe height.

Meanwhile, the specific value may be derived for deriving the CCLMparameters of the current chroma block. Here, the specific value may bereferred to as a neighboring sample number upper limit or a maximumneighboring sample number. As an example, the specific value may bederived as 2. Or, the specific value may be derived as 4, 8 or 16.

In addition, for example, the specific value may be derived as apredetermined value. That is, the specific value may be derived as avalue which is promised between the encoding apparatus and the decodingapparatus. In other words, the specific value may be derived as apredetermined value for the current chroma block to which the CCLM modeis applied.

Alternatively, for example, the decoding apparatus may obtain theprediction related information through a bitstream. In other words, thevideo information may include the information representing the specificvalue, and the specific value may be derived based on the informationrepresenting the specific value. The information representing thespecific value may be signaled in a unit of coding unit (CU). Or, theinformation representing the specific value may be signaled in a unit ofslice header, Picture Parameter Set (PPS) or Sequence Parameter Set(SPS). That is, the information representing the specific value may besignaled with a slice header, a Picture Parameter Set (PPS) or aSequence Parameter Set (SPS).

Alternatively, for example, the decoding apparatus may obtain flaginformation representing whether the number of neighboring referencesamples is derived based on the specific value through a bitstream. Inother words, the video information may include the flag informationrepresenting whether the number of neighboring reference samples isderived based on the specific value, and in the case that the flaginformation value is 1, the video information may include theinformation representing the specific value, and the specific value maybe derived based on the information representing the specific value.Meanwhile, in the case that the flag information value is 0, the flaginformation may represent that the number of neighboring referencesamples is not derived based on the specific value. The flag informationand/or the information representing the specific value may be signaledin a unit of coding unit (CU). Or, flag information and/or theinformation representing the specific value may be signaled in a unit ofslice header, Picture Parameter Set (PPS) or Sequence Parameter Set(SPS). That is, the flag information and/or the information representingthe specific value may be signaled with a slice header, a PPS or a SPS.

Alternatively, for example, the specific value may be derived based on asize of the current chroma block.

As an example, in the case that a smaller value between the width andthe height of the current chroma block is 2 or less, the specific valuemay be derived as 1, in the case that a smaller value between the widthand the height of the current chroma block is 4, the specific value maybe derived as 2, and in the case that a smaller value between the widthand the height of the current chroma block is greater than 4, thespecific value may be derived as 4.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is 2 or less, thespecific value may be derived as 1, in the case that a smaller valuebetween the width and the height of the current chroma block is 4, thespecific value may be derived as 2, in the case that a smaller valuebetween the width and the height of the current chroma block is 8, thespecific value may be derived as 4, and in the case that a smaller valuebetween the width and the height of the current chroma block is greaterthan 8, the specific value may be derived as 8.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is 2 or less, thespecific value may be derived as 1, and in the case that a smaller valuebetween the width and the height of the current chroma block is greaterthan 2, the specific value may be derived as 2.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is 2 or less, thespecific value may be derived as 1, and in the case that a smaller valuebetween the width and the height of the current chroma block is greaterthan 2, the specific value may be derived as 4.

In addition, as an example, in the case that a size of the currentchroma block is 2×2, the specific value may be derived as 1, in the casethat a smaller value between the width and the height of the currentchroma block is 2, the specific value may be derived as 2, and in thecase that a smaller value between the width and the height of thecurrent chroma block is greater than 2, the specific value may bederived as 4.

In addition, as an example, in the case that a size of the currentchroma block is 2×2, the specific value may be derived as 1, in the casethat a smaller value between the width and the height of the currentchroma block is 2, the specific value may be derived as 2, in the casethat a smaller value between the width and the height of the currentchroma block is 4, the specific value may be derived as 2, and in thecase that a smaller value between the width and the height of thecurrent chroma block is greater than 4, the specific value may bederived as 4.

In addition, as an example, in the case that a size of the currentchroma block is 2×2, the specific value may be derived as 1, in the casethat a smaller value between the width and the height of the currentchroma block is 2, the specific value may be derived as 2, in the casethat a smaller value between the width and the height of the currentchroma block is 4, the specific value may be derived as 4, and in thecase that a smaller value between the width and the height of thecurrent chroma block is greater than 4, the specific value may bederived as 4.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is 2, the specificvalue may be derived as 1, in the case that a smaller value between thewidth and the height of the current chroma block is 4, the specificvalue may be derived as 2, and in the case that a smaller value betweenthe width and the height of the current chroma block is greater than 4,the specific value may be derived as 4.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is 2, the specificvalue may be derived as 1, and in the case that a smaller value betweenthe width and the height of the current chroma block is 4, the specificvalue may be derived as 2.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is greater than 4, thespecific value may be derived as 4.

In addition, as an example, in the case that a smaller value between thewidth and the height of the current chroma block is greater than 2, thespecific value may be derived as 2.

In addition, as an example, the specific value may be derived based onwhether a smaller value between the width and the height of the currentblock is greater than a specific threshold value. For example, in thecase that a smaller value between the width and the height of thecurrent block is greater than a specific threshold value, the specificthreshold value may be derived as 4, in the case that a smaller valuebetween the width and the height of the current block is a specificthreshold value or less, the specific threshold value may be derived as2. The specific threshold value may be derived as a predetermined value.That is, the specific threshold value may be derived as a value which ispromised between the encoding apparatus and the decoding apparatus.Alternatively, for example, the video information may include theinformation representing the specific threshold value. In this case, thespecific threshold value may be derived based on the informationrepresenting the specific threshold value. For example, the derivedspecific threshold value may be 4 or 8.

The decoding apparatus may derive the neighboring chroma samples of thesample number (step, S2630). The decoding apparatus may derive theneighboring chroma samples of the sample number.

For example, in the case that the CCLM prediction mode of the currentchroma block is the left top LM mode, the decoding apparatus may deriveleft neighboring chroma samples of the sample number and the topneighboring chroma samples of the sample number. Particularly, in thecase that a size of the current chroma block is N×M, the encodingapparatus may derive the top neighboring chroma samples of the samplenumber among N top neighboring chroma samples and derive the leftneighboring chroma samples of the sample number among N left neighboringchroma samples. Here, N may be equal to or smaller than M.

In addition, for example, in the case that the CCLM prediction mode ofthe current chroma block is the top LM mode, the decoding apparatus mayderive the top neighboring chroma samples of the sample number.Particularly, in the case that a size of the current chroma block isN×M, the decoding apparatus may derive the top neighboring chromasamples of the sample number among 2N top neighboring chroma samples.Here, N may be equal to or smaller than M.

In addition, for example, in the case that the CCLM prediction mode ofthe current chroma block is the left LM mode, the decoding apparatus mayderive the left neighboring chroma samples of the sample number.Particularly, in the case that a size of the current chroma block isM×N, the decoding apparatus may derive the left neighboring chromasamples of the sample number among 2N left neighboring chroma samples.Here, N may be equal to or smaller than M.

The decoding apparatus may derive down-sampled neighboring luma samplesand down-sampled luma samples of the current luma block (step, S2640).Here, the neighboring luma samples may correspond to the neighboringchroma samples. For example, the down-sampled neighboring luma samplesmay include down-sample top neighboring luma samples of the current lumablock corresponding to the top neighboring chroma samples anddown-sampled left neighboring luma samples of the current luma blockcorresponding to the left neighboring chroma samples.

That is, for example, the neighboring luma samples may includedown-sample top neighboring luma samples of the sample numbercorresponding to the top neighboring chroma samples and down-sampledleft neighboring luma samples of the sample number corresponding to theleft neighboring chroma samples.

Alternatively, for example, the down-sampled neighboring luma samplesmay include down-sample top neighboring luma samples of the current lumablock corresponding to the top neighboring chroma samples. That is, forexample, the neighboring luma samples may include down-sample topneighboring luma samples of the sample number corresponding to the topneighboring chroma samples.

Alternatively, for example, the down-sampled neighboring luma samplesmay include down-sampled left neighboring luma samples of the currentluma block corresponding to the left neighboring chroma samples. Thatis, for example, the neighboring luma samples may include down-sampledleft neighboring luma samples of the sample number corresponding to theleft neighboring chroma samples.

The decoding apparatus derives CCLM parameters based on the neighboringchroma samples and the down-sampled neighboring luma samples (step,S2650). The decoding apparatus may derive the CCLM parameters based onthe neighboring chroma samples and the down-sampled neighboring lumasamples. For example, the CCLM parameters may be derived based onEquation 3 described above. Alternatively, for example, the CCLMparameters may be derived based on Equation 4 described above.

The decoding apparatus derives prediction samples for the current chromablock based on the CCLM parameters and the down-sampled luma samples(step, S2660). The decoding apparatus may derive the prediction samplesfor the current chroma block based on the CCLM parameters and thedown-sampled luma samples. The decoding apparatus may apply the CCLMderived by the CCLM parameters to the own-sampled luma samples andgenerate prediction samples for the current chroma block. That is, thedecoding apparatus may perform a CCLM prediction based on the CCLMparameters and generate prediction samples for the current chroma block.For example, the prediction samples may be derived based on Equation 1described above.

The decoding apparatus generates reconstructed samples for the currentchroma block based on the prediction samples (step, S2670). The decodingapparatus may generate the reconstructed samples based on the predictionsamples. For example, the decoding apparatus may receive information fora residual for the current chroma block from the bitstream. Theinformation for the residual may include a transform coefficient for the(chroma) residual sample. The decoding apparatus may derive the residualsample (or residual sample array) for the current chroma block based onthe residual information. In this case, the decoding apparatus maygenerate the reconstructed samples based on the prediction samples andthe residual sampled. The decoding apparatus may derive a reconstructedblock or a reconstructed picture based on the reconstructed sample.Later, the decoding apparatus may apply the in-loop filtering proceduresuch as deblocking filtering and/or SAO process to the reconstructedpicture to improve subjective/objective image quality, as describedabove.

FIG. 27 schematically illustrates a decoding apparatus for performing avideo decoding method according to the present disclosure. The methodshown in FIG. 26 may be performed by the decoding apparatus shown inFIG. 27. In a specific example, the entropy decoder of the decodingapparatus of FIG. 27 may perform step S2600 of FIG. 26, the predictor ofthe decoding apparatus of FIG. 27 may perform steps S2610 to S2660 ofFIG. 26, and the adder of the decoding apparatus of FIG. 27 may performstep S2670 of FIG. 26. In addition, although it is not shown in thedrawings, the process of acquiring information for residual of thecurrent block through a bitstream may be performed by the entropydecoder of the decoding apparatus, and the process of deriving theresidual sample for the current block based on the residual informationmay be performed by the inverse transformer of the decoding apparatus ofFIG. 27.

According to the present disclosure described above, an intra-predictionis performed based on CCLM, and video coding efficiency may be improved.

In addition, according to the present disclosure, the efficiency ofintra-prediction can be improved, which is based on CCLM including aplurality of LM modes, that is, multi-directional Linear Model (MDLM).

In addition, according to the present disclosure, the number ofneighboring samples selected for deriving a linear model parameter formulti-directional Linear Model (MDLM) performed in a chroma block havinga great size is limited to a specific number, and accordingly,intra-prediction complexity can be reduced.

In the above-described embodiment, the methods are described based onthe flowchart having a series of steps or blocks. The present disclosureis not limited to the order of the above steps or blocks. Some steps orblocks may occur simultaneously or in a different order from other stepsor blocks as described above. Further, those skilled in the art willunderstand that the steps shown in the above flowchart are notexclusive, that further steps may be included, or that one or more stepsin the flowchart may be deleted without affecting the scope of thepresent disclosure.

The embodiments described in this specification may be performed bybeing implemented on a processor, a microprocessor, a controller or achip. For example, the functional units shown in each drawing may beperformed by being implemented on a computer, a processor, amicroprocessor, a controller or a chip. In this case, information forimplementation (e.g., information on instructions) or algorithm may bestored in a digital storage medium.

In addition, the decoding device and the encoding device to which thepresent disclosure is applied may be included in a multimediabroadcasting transmission/reception apparatus, a mobile communicationterminal, a home cinema video apparatus, a digital cinema videoapparatus, a surveillance camera, a video chatting apparatus, areal-time communication apparatus such as video communication, a mobilestreaming apparatus, a storage medium, a camcorder, a VoD serviceproviding apparatus, an Over the top (OTT) video apparatus, an Internetstreaming service providing apparatus, a three-dimensional (3D) videoapparatus, a teleconference video apparatus, a transportation userequipment (e.g., vehicle user equipment, an airplane user equipment, aship user equipment, etc.) and a medical video apparatus and may be usedto process video signals and data signals. For example, the Over the top(OTT) video apparatus may include a game console, a blue-ray player, aninternet access TV, a home theater system, a smart phone, a tablet PC, aDigital Video Recorder (DVR), and the like.

Furthermore, the processing method to which the present disclosure isapplied may be produced in the form of a program that is to be executedby a computer and may be stored in a computer-readable recording medium.Multimedia data having a data structure according to the presentdisclosure may also be stored in computer-readable recording media. Thecomputer-readable recording media include all types of storage devicesin which data readable by a computer system is stored. Thecomputer-readable recording media may include a BD, a Universal SerialBus (USB), ROM, PROM, EPROM, EEPROM, RAM, CD-ROM, a magnetic tape, afloppy disk, and an optical data storage device, for example.Furthermore, the computer-readable recording media includes mediaimplemented in the form of carrier waves (e.g., transmission through theInternet). In addition, a bit stream generated by the encoding methodmay be stored in a computer-readable recording medium or may betransmitted over wired/wireless communication networks.

In addition, the embodiments of the present disclosure may beimplemented with a computer program product according to program codes,and the program codes may be performed in a computer by the embodimentsof the present disclosure. The program codes may be stored on a carrierwhich is readable by a computer.

FIG. 28 illustrates a structural diagram of a contents streaming systemto which the present disclosure is applied.

The content streaming system to which the embodiment(s) of the presentdocument is applied may largely include an encoding server, a streamingserver, a web server, a media storage, a user device, and a multimediainput device.

The encoding server compresses content input from multimedia inputdevices such as a smartphone, a camera, a camcorder, etc. into digitaldata to generate a bitstream and transmit the bitstream to the streamingserver. As another example, when the multimedia input devices such assmartphones, cameras, camcorders, etc. directly generate a bitstream,the encoding server may be omitted.

The bitstream may be generated by an encoding method or a bitstreamgenerating method to which the embodiment(s) of the present document isapplied, and the streaming server may temporarily store the bitstream inthe process of transmitting or receiving the bitstream.

The streaming server transmits the multimedia data to the user devicebased on a user's request through the web server, and the web serverserves as a medium for informing the user of a service. When the userrequests a desired service from the web server, the web server deliversit to a streaming server, and the streaming server transmits multimediadata to the user. In this case, the content streaming system may includea separate control server. In this case, the control server serves tocontrol a command/response between devices in the content streamingsystem.

The streaming server may receive content from a media storage and/or anencoding server. For example, when the content is received from theencoding server, the content may be received in real time. In this case,in order to provide a smooth streaming service, the streaming server maystore the bitstream for a predetermined time.

Examples of the user device may include a mobile phone, a smartphone, alaptop computer, a digital broadcasting terminal, a personal digitalassistant (PDA), a portable multimedia player (PMP), navigation, a slatePC, tablet PCs, ultrabooks, wearable devices (ex. smartwatches, smartglasses, head mounted displays), digital TVs, desktops computer, digitalsignage, and the like. Each server in the content streaming system maybe operated as a distributed server, in which case data received fromeach server may be distributed.

1-15. (canceled)
 16. A video decoding method performed by a decodingapparatus, the method comprising: obtaining video information comprisingprediction mode information for a current chroma block; deriving a leftcross-component linear model (CCLM) prediction mode as an intraprediction mode of the current chroma block based on the prediction modeinformation; deriving a sample number of left neighboring chroma samplesof the current chroma block based on a height of the current chromablock and a specific value; deriving the left neighboring chroma samplesof the sample number; deriving down sampled left neighboring lumasamples related with the left neighboring chroma samples and downsampled luma samples of a current luma block; deriving CCLM parametersbased on the left neighboring chroma samples and the down sampled leftneighboring luma samples; deriving prediction samples for the currentchroma block based on the CCLM parameters and the down sampled lumasamples; and generating reconstructed samples for the current chromablock based on the prediction samples, wherein the specific value isderived as 2, wherein the height of the current chroma block is N,wherein based on 2N being less than or equal to twice the specificvalue, the sample number of the left neighboring chroma samples isderived as 2N, and based on the 2N being greater than twice the specificvalue, the sample number of the left neighboring chroma samples isderived as
 4. 17. The method of claim 16, wherein the prediction modeinformation includes index information indicating one of CCLM predictionmodes, and wherein the CCLM prediction modes includes a left top CCLMmode, a top CCLM mode and the left CCLM mode.
 18. The method of claim16, wherein the specific value is derived as a predetermined value forthe current chroma block to which the left CCLM mode is applied.
 19. Themethod of claim 16, wherein information on the specific value issignaled in a unit of coding unit (CU).
 20. The method of claim 16,wherein information on the specific value is signaled with a sliceheader, a Picture Parameter Set (PPS) and a Sequence Parameter Set(SPS).
 21. A video encoding method performed by an encoding apparatus,the method comprising: deriving a left cross-component linear model(CCLM) prediction mode as an intra prediction mode of the current chromablock; deriving a sample number of left neighboring chroma samples ofthe current chroma block based on a height of the current chroma blockand a specific value; deriving the left neighboring chroma samples ofthe sample number; deriving down sampled left neighboring luma samplesrelated with the left neighboring chroma samples and down sampled lumasamples of a current luma block; deriving CCLM parameters based on theleft neighboring chroma samples and the down sampled left neighboringluma samples; deriving prediction samples for the current chroma blockbased on the CCLM parameters and the down sampled luma samples; andencoding video information including prediction mode information for thecurrent chroma block, wherein the specific value is derived as 2,wherein the height of the current chroma block is N, wherein based on 2Nbeing less than or equal to twice the specific value, the sample numberof the left neighboring chroma samples is derived as 2N, and based onthe 2N being greater than twice the specific value, the sample number ofthe left neighboring chroma samples is derived as
 4. 22. The method ofclaim 21, wherein the prediction mode information includes indexinformation indicating one of CCLM prediction modes, and wherein theCCLM prediction modes includes a left top CCLM mode, a top CCLM mode andthe left CCLM mode.
 23. The method of claim 21, wherein the specificvalue is derived as a predetermined value for the current chroma blockto which the left CCLM mode is applied.
 24. The method of claim 21,wherein information on the specific value is signaled in a unit ofcoding unit (CU).
 25. The method of claim 21, wherein information on thespecific value is signaled with a slice header, a Picture Parameter Set(PPS) and a Sequence Parameter Set (SPS).
 26. A non-transitorycomputer-readable storage medium storing a bitstream causing a decodingapparatus to perform a video decoding method, the method comprising:obtaining video information comprising prediction mode information for acurrent chroma block; deriving a left cross-component linear model(CCLM) prediction mode as an intra prediction mode of the current chromablock based on the prediction mode information; deriving a sample numberof left neighboring chroma samples of the current chroma block based ona height of the current chroma block and a specific value; deriving theleft neighboring chroma samples of the sample number; deriving downsampled left neighboring luma samples related with the left neighboringchroma samples and down sampled luma samples of a current luma block;deriving CCLM parameters based on the left neighboring chroma samplesand the down sampled left neighboring luma samples; deriving predictionsamples for the current chroma block based on the CCLM parameters andthe down sampled luma samples; and generating reconstructed samples forthe current chroma block based on the prediction samples, wherein thespecific value is derived as 2, wherein the height of the current chromablock is N, wherein based on 2N being less than or equal to twice thespecific value, the sample number of the left neighboring chroma samplesis derived as 2N, and based on the 2N being greater than twice thespecific value, the sample number of the left neighboring chroma samplesis derived as
 4. 27. The method of claim 26, wherein the prediction modeinformation includes index information indicating one of CCLM predictionmodes, and wherein the CCLM prediction modes includes a left top CCLMmode, a top CCLM mode and the left CCLM mode.
 28. The method of claim26, wherein the specific value is derived as a predetermined value forthe current chroma block to which the left CCLM mode is applied.
 29. Themethod of claim 26, wherein information on the specific value issignaled in a unit of coding unit (CU).
 30. The method of claim 26,wherein information on the specific value is signaled with a sliceheader, a Picture Parameter Set (PPS) and a Sequence Parameter Set(SPS).